在本地远程用SQLyog连接云服务器mysql时出现Host XXX is not allowed to connect to this MySQL server错误。
原因是linux上的mysql设置只能本机使用
解决方法:
1、利用Xshell登录mysql
mysql -uroot -p
2、使用mysql数据库表,并查看主机配置信息
use mysql
select host from user where user='root';
可以看到只有当前主机才能访问
3、更改配置
update user set host = '%' where user ='root'