在应用部署后访问中出现一下错误:
ERROR 1130: Host ‘localhost’ is not allowed to connect to this MySQL server
其实就是 MySQL 不允许当前的Host进行连接。为了本地以后测试方便,暴力解决方法如下:
- 1.在装有MySQL的机器上登录MySQL:mysql -uroot -p密码
- 2.选择我mysql库,执行use mysql;
- 3.更新user表,执行update user set host = ‘%’ where user = ‘root’;这一句执行完可能会报错,不用管它。
- 4.执行FLUSH PRIVILEGES;

转载请注明:清风亦平凡 » Host is not allowed to connect to this MySQL server问题