Home >Database >navicat >Solve the problem of 2003 when connecting to navicat

Solve the problem of 2003 when connecting to navicat

hzc
hzcOriginal
2020-06-13 17:13:3521530browse

Solve the problem of 2003 when connecting to navicat

Solution to 2003 when connecting to navicat:

(1) Check which ports are open netstat -anp

Solve the problem of 2003 when connecting to navicat

127.0.0.1:3306 -- means that the mysql database can only be accessed locally;

(2) We put 127.0.0.1: 3306 is changed to 0.0.0.0:3306, so that all users can remotely access the mysql database;

Open/etc/mysql/mysql.cnf Findbind- address= 127.0.0.1 Change it to bind-address= 0.0.0.0

(mysql5.7.24 version, the configuration file directory is: /etc/mysql/ mysql.conf.d/mysqld.cnf)

Solve the problem of 2003 when connecting to navicat

Restart takes effect;

Command:service mysql restart

(3) After executing the second step and testing to connect to mysql, an error will still be reported: "1130 is not allowed to connect to this MySql server". This is because permissions are not enabled.

Execute under the linux server:

1.mysql -u root -pPress Enter, enter the password and press Enter, log in;

2. Authorize remote user login

1. Authorize all root users:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root user Password' WITH GRANT OPTION;

2. Authorize the root user of the specified IP:

GRANT ALL PRIVILEGES ON *.* TO root@'specified IP address' IDENTIFIED BY 'root user password' WITH GRANT OPTION;

3. You can also authorize the specified table, which is not so troublesome. Anyway, you can use it locally.

3. Reload the authorization table: FLUSH PRIVILEGES;

4.exit ExitMysql

(4) Test the connection and the connection is successful.

Recommended tutorial: "navicat tutorial"

The above is the detailed content of Solve the problem of 2003 when connecting to navicat. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn