1130, "Host 'xxxx' is not allowed to connect to this MySQL server"

1130, "Host 'xxxx' is not allowed to connect to this MySQL server"

问题描述:

1. 在centos装好mysql后,在python3程序中通过pymysql远程连接mysql,但是报 Host '*' not allowed connect错误

解决方法:

1. 修改mysql权限表 

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

2. 先查看原先数据库的权限信息,发现只有172.17.37.51 host具有root权限,我们需要改成所有host

  1.  
    use mysql;
  2.  
    select host,user from user;

 3. 修改权限,但是报了一个1062错误,我们不予理会

4. 直接在当前状态下 重新远程连接OK

flush privileges;

5. 再次查看mysql数据库的user表信息,发现OK

6. 然后再次运行python程序,问题解决。

posted on 2019-12-23 15:58  王大拿  阅读(123)  评论(0)    收藏  举报

导航