message from server: "Host '192.168.1.10' is not allowed to connect to this MySQL server

来源:互联网 发布:怎么加入淘宝充值平台 编辑:程序博客网 时间:2024/06/01 08:25

在连接本机的mysql 数据库时,配置连接信息,连接发生错误,提示:message from server: "Host '192.168.1.10' is not allowed to connect to this MySQL server

但是将IP地址改为localhost又能正常连接到MySQL数据库。

临时处理方案:

1、先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql;

          use mysql; 


2、执行:select host from user where user = 'root';  发现,host的值就是localhost。

     所以将它的值改掉:update user set host='%' where user = 'root'; 


3、修改完成后,执行:flush privileges;  

     将修改内容生效,再次配置时,用IP地址或者localhost 就都能正常连接到MySQL数据库了。




0 0
原创粉丝点击