本地连接阿里云 MySQL 时出现 Host is not allowed to connect to this MySQL server 解决方法

先说说这个错误,其实就是我们的MySQL不允许远程登录,所以远程登录失败了,解决方法如下:

在装有MySQL的机器上登录 MySQL

mysql -u root -p密码

进入 mysql 后执行

use mysql;

执行下面一行。这一句执行完可能会报错,不用管它。

update user set host = '%' where user = 'root';

执行

FLUSH PRIVILEGES;

原文链接:Host is not allowed to connect to this MySQL server解决方法

发表评论