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

Introduction to using MySQL commands to create, delete, and query indexes

MySQL database tables can create, view, rebuild a...

Win10 installation Linux system tutorial diagram

To install a virtual machine on a Windows system,...

Detailed explanation of daily_routine example code in Linux

First look at the example code: #/bin/bash cal da...

An article to help you understand jQuery animation

Table of contents 1. Control the display and hidi...

Vue implements nested routing method example

1. Nested routing is also called sub-routing. In ...

UDP simple server client code example

I won’t go into details about the theory of UDP. ...

MySQL trigger detailed explanation and simple example

MySQL trigger simple example grammar CREATE TRIGG...

Detailed explanation of MySQL and Spring's autocommit

1 MySQL autocommit settings MySQL automatically c...

HTML table markup tutorial (15): table title

<br />This tag can be used to directly add a...

Detailed tutorial on how to create a user in mysql and grant user permissions

Table of contents User Management Create a new us...

CSS to implement QQ browser functions

Code Knowledge Points 1. Combine fullpage.js to a...

JavaScript canvas to achieve raindrop effects

This article example shares the specific code of ...

Sample code for implementing follow ads with JavaScript

Floating ads are a very common form of advertisin...