Navicat solve error: 1130-host is not allowed MySQL does not allow remote access from a method

1. Check the server firewall is turned off; whether it is caused by a firewall;

2. Check through the network link, check the port: telnet ip port number

3. Check the MySQL user

Enter the command line mysql database

C:\Saftware\mysql\bin>mysql -u root -p

# Switch to the MySQL database;

mysql> use mysql;
Database changed
mysql> update user set host = '%' ;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 3  Changed: 0  Warnings: 0

# MySQL user query the database and configuration

mysql> select host,user from user;
+------+---------------+
| host | user          |
+------+---------------+
| %    | mysql.session |
| %    | mysql.sys     |
| %    | root          |
+------+---------------+
3 rows in set (0.00 sec)

# Authorized users can remotely link

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)

# Commit the transaction

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit

The most important thing, then quit the database, you need to restart the MySQL service, otherwise, is not in force, is not too remote link on the MySQL database;

Command to restart the service: net start mysql;

Stop service command: net stop mysql; 

Guess you like

Origin www.cnblogs.com/qianshouxiuluo/p/11735839.html