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

Install MySQL in Ubuntu 18.04 (Graphical Tutorial)

Tip: The following operations are all performed u...

Solution to find all child rows for a given parent row in MySQL

Preface Note: The test database version is MySQL ...

How to solve the abnormal error ERROR: 2002 in mysql

Recently, an error occurred while starting MySQL....

A graphic tutorial on how to install MySQL in Windows

Abstract: This article mainly explains how to ins...

How InnoDB cleverly implements transaction isolation levels

Preface In the previous article Detailed Explanat...

Solution to slow response of Tomcat server

1. Analytical thinking 1. Eliminate the machine&#...

Detailed explanation of how Node.js middleware works

Table of contents What is Express middleware? Req...

Sample code for highlighting search keywords in WeChat mini program

1. Introduction When you encounter a requirement ...

My personal summary of mysql 5.7 database installation steps

1.mysql-5.7.19-winx64.zip (this is the free insta...

How to implement a simple HTML video player

This article introduces the method of implementin...

CenOS6.7 mysql 8.0.22 installation and configuration method graphic tutorial

CenOS6.7 installs MySQL8.0.22 (recommended collec...

Record of the actual process of packaging and deployment of Vue project

Table of contents Preface 1. Preparation - Server...

How to use Samba to build a shared file service on a Linux server

Recently, our small team needs to share a shared ...