Navicat remote connection to MySQL implementation steps analysis

Navicat remote connection to MySQL implementation steps analysis

Preface

I believe that everyone has been developing on a remote server, and the usage rate of MySQL should be quite high. It is a good choice to use visual tools such as Navicat to operate the remote database, avoiding the operation of writing SQL statements on the command line. The following is a brief introduction to the operation of Navicat connecting to a remote database.

1

First, we need to change port 3306 and check whether it is open to the outside world. By default, MySQL does not allow external access. The statement is as follows:

netstat -an | grep 3306

If the query results are as follows, we need to change the MySQL configuration file.

It can be seen that the MySQL port 3306 only listens to local connections, which prevents external IP from accessing the database. Modify the MySQL configuration file my.conf:

vim /etc/mysql/my.cnf

turn up

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1

Comment out the line bind-address = 127.0.0.1 or change it to the client host ip you want to use.

At this point, the MySQL remote access port has been successfully opened.

2

We enter the MySQL command interface and run the following SQL statement to check whether the user has access rights:

use mysql;
select user, host from user;

The returned results are as follows:

We use the wildcard % to modify the host field corresponding to the root user so that he has access to all IP addresses:

update user set host = '%' where user = 'root';

If the following exception is thrown:

Duplicate entry '%-root' for key 'PRIMARY'

This indicates that there are multiple ROOT user records in the USER table. Let's re-execute:

select host from user where user = 'root';

You can see the % value of the host field.

We perform:

flush privileges;

Refresh the MySQL system privilege related tables.

Finally, restart the MySQL service:

sudo restart mysql

3

The server is set up, let's set up the connection in the Navicat client:

Open Navicat, click "Connect" in the upper left corner, set the database username, address, password, etc., and you can remotely operate MySQL on the server in Navicat.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • When Navicat Premium connects to the database, the error message appears: 2003 Can't connect to MySQL server on''localhost''(10061)
  • How to solve the 10060 unknow error when Navicat remotely connects to MySQL
  • Solve the problem that Navicat cannot connect to MySQL on the Linux server
  • Solve the 1251 error when establishing a connection between mysql and navicat
  • Detailed explanation of the idea of ​​installing mysql8.0.11 and changing the root password and connecting navicat for mysql
  • Solution to 1045 error when navicat connects to mysql
  • About the problem of Navicat connecting to MySql database slowly

<<:  SELinux Getting Started

>>:  Implement full screen and monitor exit full screen in Vue

Recommend

Detailed steps for QT to connect to MYSQL database

The first step is to add the corresponding databa...

Web front-end skills summary (personal practical experience)

1. Today, when I was making a page, I encountered ...

Some findings and thoughts about iframe

This story starts with an unexpected discovery tod...

JavaScript data structure bidirectional linked list

A singly linked list can only be traversed from t...

How to install vim editor in Linux (Ubuntu 18.04)

You can go to the Ubuntu official website to down...

Detailed explanation of VUE Token's invalidation process

Table of contents Target Thought Analysis Code la...

Detailed explanation of the use of DockerHub image repository

Previously, the images we used were all pulled fr...

8 Reasons Why You Should Use Xfce Desktop Environment for Linux

For several reasons (including curiosity), I star...

Transplanting the mkfs.vfat command in busybox under Linux system

In order to extend the disk life for storing audi...

Correct modification steps for Docker's default network segment

background A colleague is working on his security...

Website construction experience summary

<br />What principles should be followed to ...

Analysis of Sysbench's benchmarking process for MySQL

Preface 1. Benchmarking is a type of performance ...

Vue realizes adding watermark to uploaded pictures (upgraded version)

The vue project implements an upgraded version of...

jQuery implements sliding tab

This article example shares the specific code of ...