Host is not allowed to connect to this MySQL server 解决方法
先说说这个错误,其实就是我们的MySQL不允许远程登录,所以远程登录失败了。
解决方法:
1、在装有MySQL的机器上登录:
$ mysql -u root -p
2、执行
> use mysql;
3、执行(允许来自任意 host 主机的连接,使用 root 用户登录)
> update user set host = '%' where user = 'root';
4、执行
> FLUSH PRIVILEGES;
经过上面4步,就可以解决这个问题了。
注: 第4步是刷新MySQL的权限相关表。

浙公网安备 33010602011771号