虚拟机装好MySQL发现本地可以连接,远程却不行,开放3306端口后出现错误:Host 'xxx' is not allowed to connect to this MySQL server
解决方案:
本地登录MySQL之后执行如下命令:
选中mysql数据库
use mysql;
更新host
update user set host = '%' where user = 'root';
刷新权限
FLUSH PRIVILEGES;
虚拟机装好MySQL发现本地可以连接,远程却不行,开放3306端口后出现错误:Host 'xxx' is not allowed to connect to this MySQL server
解决方案:
本地登录MySQL之后执行如下命令:
选中mysql数据库
use mysql;
更新host
update user set host = '%' where user = 'root';
刷新权限
FLUSH PRIVILEGES;