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

在linux服务器上装好mysql测试没问题后,在本地远程连接出现了Host is not allowed to connect to this MySQL server的问题,找了很多网上的办法都没有用,终于找到了一个有用的分享给大家。

解决方法如下:

  1. mysql -uroot -proot
  2. useuse mysql;
  3. 执行update user set host = '%' where user = 'root';
  4. 执行FLUSH PRIVILEGES;

执行完毕,重启mysql服务,service mysqld restart

问题解决,连接成功。

猜你喜欢

转载自blog.csdn.net/u012998306/article/details/80500474