Host "xxx.xxx.xxx.xxx" is not allowes to connect to this MySQL severe.

原因:

这里的 xxx.xxx.xxx.xxx 是你自己电脑的IP地址,出现这个错误的原因是你的服务器中的数据库之允许本地访问,即从数据库访问,外部连接是访问不到的。

解决方法:

修改MySQL数据库中的 user表格,将host的“localhost”修改为“%”,然后重启MySQL服务。
可以通过代码修改

update user set host='%' where user='root';

也可以使用可视化工具进行修改
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/FutureDr/article/details/83893429