远程连接mysql出错1130 not allowed to connect to this server

尝试远程连接服务器的mysql数据库,结果出现

1130 Response from the database: Host is not allowed to connect to this MySQL server。

按照提示搜了一下,是服务器的MySQL限制了外界连接,命令行下输入

use mysql;

select host from user where user='xxx';

 

回车显示

 

说明目前是限制只能localhost连接,

要远程连接需要修改

update user set host = '%' where user ='xxx';
flush privileges;

再尝试可以连接了。

 

posted @ 2020-03-08 17:52  hanzhang  阅读(433)  评论(0)    收藏  举报