navicat连接数据库报1130 - Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server

错误原因:

用Navicat连接远程MySQL数据库时,出现“1130 - Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server”,提示错误内容为不允许连接MySQL服务。很多人都以为是防火墙在作怪,其实关掉防火墙依然不能解决这个问题,其实是是mysql无法给远程连接的用户权限问题

解决办法如下:

>mysql -u root -p123456
>use mysql
>update user set host='%' where user='root';
>select host,user from user;
>flush privileges;

然后Navcat重新连接就好了,完美搞定

猜你喜欢

转载自blog.csdn.net/m0_43413873/article/details/111570884
今日推荐