mysql 远程连接出错问题

当安装好mysql后,想通过远程连接,出现ERROR 1130 (HY000): Host '***' is not allowed to connect to this MySQL server的解决办法。

  1. 通过本地连接进入mysql:在cmd下输入mysql -h localhost -uroot -p******
  2. 执行"use mysql;",回车;
  3. 执行"update mysql.user set Host='%' where Host = 'localhost';"
  4. 执行"grant all privileges on *.* to root@"%";"
  5. 执行"flush privileges;",大功告成。
原文地址:https://www.cnblogs.com/zds-blog/p/3676111.html