Host is not allowed to connect to this MySQL server解决方法

来源:互联网 发布:优化发展环境整改措施 编辑:程序博客网 时间:2024/06/05 16:29

远程访问MySQL时,提示Host is not allowed to connect to this MySQL server

解决方法如下:

  1. 在装有MySQL的机器上登录MySQL mysql -u root -p密码
  2. 执行use mysql;
  3. 执行update user set host = '%' where user = 'root';这一句执行完可能会报错,不用管它。
  4. 执行FLUSH PRIVILEGES;

    经过上面4步,就可以解决这个问题了。
    注: 第四步是刷新MySQL的权限相关表,一定要执行


阅读全文
0 0