Navicat 连接远程数据库报错:1130 - Host "XX.XX.XX.XX" is not allowed to connect to this MySQL server

 

Navicat 连接远程数据库报错:1130 - Host "XX.XX.XX.XX" is not allowed to connect to this MySQL server

 

 

1.连接服务器:

 mysql -u root -p

 

 

2.看当前所有数据库:

show databases;

 

 

3.进入mysql数据库:

use mysql;

 

 

4.查看mysql数据库中所有的表:

show tables;

 

 

5.查看 user 表中的数据:

select Host, User from user;

 

 

 

6.修改user表中的Host:

update user set Host='%' where User='root';

 

 

 

再次查看 user 表中的数据:

select Host, User from user;

 

 

7.刷新权限:

flush privileges;

 

 

 再次去连接,就成功了

 

posted on 2019-05-31 18:03  D小调的微笑  阅读(221)  评论(0编辑  收藏  举报