How to remotely connect to MySQL database with Navicat Premium

How to remotely connect to MySQL database with Navicat Premium

The party that creates a new connection is equivalent to the client, and the one being connected is equivalent to the server. The steps are as follows:

1. Create a subaccount and type the following authorization commands in the Navicat query interface and execute them in sequence:

GRANT ALL PRIVILEGES
ON test.* to 'root333'@"%"
IDENTIFIED by 'abc111' WITH GRANT OPTION;

FLUSH PRIVILEGES;
  • all PRIVILEGES means all permissions;
  • on is followed by the database name. For example, test.* means that the permissions granted are for all tables under the database test. *.* means that any table in any database is authorized.
  • The "to" after the "to" is the username granted to that computer. The "root333" before the "@" symbol represents the subaccount name, which is the "user name" when connecting to the MySQL server later. The "@" symbol after the "@" symbol is the IP address of the computer granted to that computer. The "%" symbol represents any IP address.
  • IDENTIFIED BY is followed by a password;
  • FLUSH PRIVILEGES: Refresh permissions.

2. Create a new MySQL connection (1)

insert image description here

Connection name: choose your own Host: Enter the server host address you want to connect to Port: Default is 3306
Username: The subaccount name before the @ symbol in authorization 1 Password: The password after IDENTIFIED BY in authorization 1 (2) Click "Test Connection"

insert image description here

The "Connection successful" pop-up message indicates that the connection is successful. Now we can operate the database on the corresponding server.

3. To delete sub-user permissions, type

DELETE FROM mysql.`user` where User='username' AND Host='IP';

Username: The subaccount name set during authorization
IP: represents the IP address of the computer, and % represents all. At this time, if you try to connect using a sub-account, you will be prompted that the connection is rejected.

This is the end of this article about how to use Navicat Premium to remotely connect to a MySQL database. For more information about how to use Navicat Premium to remotely connect to a MySQL database, please search for previous articles on 123WORDPRESS.COM or continue browsing the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Migrate Oracle database to MySQL using Navicat Premium
  • Navicat Premium operates MySQL database (executes sql statements)
  • When Navicat Premium connects to the database, the error message appears: 2003 Can't connect to MySQL server on''localhost''(10061)
  • Analysis on how to solve the problem of Navicat Premium connecting to MySQL 8.0 and reporting error "1251"
  • Navicat Premium 15 permanent crack activation tool and installation tutorial (professional test available)
  • Detailed process of installing and configuring MySQL and Navicat prenium

<<:  Six inheritance methods in JS and their advantages and disadvantages

>>:  Table Tag (table) In-depth

Recommend

Pure CSS to achieve cloudy weather icon effect

Effect The effect is as follows ​ Implementation ...

How to build a private Docker repository using Harbor

Table of contents 1. Open source warehouse manage...

How to use video.js in vue to play m3u8 format videos

Table of contents 1. Installation 2. Introducing ...

Writing a shell script in Ubuntu to start automatically at boot (recommended)

The purpose of writing scripts is to avoid having...

15 important variables you must know about MySQL performance tuning (summary)

Preface: MYSQL should be the most popular WEB bac...

A complete list of commonly used HTML tags and their characteristics

First of all, you need to know some characteristi...

Why MySQL database avoids NULL as much as possible

Many tables in MySQL contain columns that can be ...

A brief summary of all encapsulation methods in Vue

Table of contents 1. Encapsulation API 2. Registe...

Detailed tutorial for installing mysql 8.0.12 under Windows

This article shares with you a detailed tutorial ...

WeChat applet realizes linkage menu

Recently, in order to realize the course design, ...

Understanding MySQL precompilation in one article

1. Benefits of precompilation We have all used th...

Setting up a proxy server using nginx

Nginx can use its reverse proxy function to imple...