java.sql.SQLException: null, message from server: "Host 'xxx.xxx.xxx.xxx' is not allowed to connect

java.sql.SQLException: null, message from server: "Host 'xxx.xxx.xxx.xxx' is not allowed to connect

绿林寻猫
2021-12-08 / 0 评论 / 200 阅读 / 正在检测是否收录...

其实道理很简单,也就是说,远程的机器B不允许机器A访问他的数据库。

一:打开mysql控制台

#use mysql;

#show tables;

 

二:输入

#select host from user;

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

 

三:使用 service 启动
#service mysqld restart 

然后再访问就没有问题了

0

评论 (0)

取消