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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_40369944/article/details/85007638

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

一:打开mysql控制台

#use mysql;

#show tables;

二:输入

#select host from user;

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

三:使用 service 启动
#service mysqld restart 

然后再访问就没有问题了

猜你喜欢

转载自blog.csdn.net/qq_40369944/article/details/85007638