MySql高级技术-解决mysql不能远程连接

Host xxx is not allowed to connect to this MySQL server 问题

Posted by LQFGH on January 20, 2019

文章参考:

本地登陆远程MySQL是报错 Host xxx is not allowed to connect to this MySQL server

登陆远程主机看下mysql库中的user表中的 root 用户的 host 地址
1
2
use mysql;
select host from user where user='root';
将host地址改为 ‘%’ 即可
1
update user set host = '%' where user = 'root';
设置完了刷新下权限相关表
1
FLUSH PRIVILEGES;