Host * is not allowed to connect to this MySQL server

解决方案:
本机登入mysql后,更改"mysql"数据库里的"user"表里的"host"项,从"localhost"改为’%’。
操作步骤:

执行命令 mysql -u root -p
执行use mysql
执行update user set host = '%' where user = 'root';
执行FLUSH PRIVILEGES;刷新权限表
在执行第三步的时候会报错,不需要管,直接执行第四步,然后就可以连接了

发布了104 篇原创文章 · 获赞 18 · 访问量 8627

猜你喜欢

转载自blog.csdn.net/y368769/article/details/103887577