When Navicat connects to a database on a server, there is an error prompt: 1130 ‘* *’ host is not allowed to connect to this MySQL server

An error is reported when using Navicat to connect to a database, as shown in the figure:

 

Reason: the user in the MySQL database in the database server does not have permission in the table (it can also be said that there is no user)

Solution: enter the database of the server first, MySQL – U root – P

Look at all the current databases, show databases;

Enter the MySQL database and use MySQL;

View all tables in MySQL database    show tables;

Modify the host in the user table: update user set host = ‘%’ where user =’root ‘;

Refresh permissions: flush privileges;

 

Reconnection will succeed

I use this scheme. The personal test is effective. In addition, there are other methods

For example, any remote host can access the database and enter the database operation

GRANT   ALL   PRIVILEGES   ON  *.*  TO  ‘ root’@’%’WITH   GRANT   OPTION;      

FLUSH   PRIVILEGES;  

Also, look at the firewall, because the firewall is closed. Let the firewall open port 3306: iptables – I input – P TCP – s 0.0.0.0/0 — dport 3306  – j ACCEPT       This approach is actually useless.

Similar Posts: