转自 https://blog.csdn.net/yang5726685/article/details/52529082

Mysql连接报错:java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to conn

原因是:远程服务器不允许你的java程序访问它的数据库。所以,我们要对远程服务器进行设置,使它允许你进行连接。

步骤:一、打开mysql控制台,输入:use mysql;

Mysql连接报错:java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to conn

二、输入:show tables;

Mysql连接报错:java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to conn

三、输入:select host from user;

Mysql连接报错:java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to conn

四、输入:update user set host ='%' where user ='root';

Mysql连接报错:java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to conn

五、打开计算机的服务界面,重新启动mysql服务,远程服务器就允许程序连接数据库了。

Mysql连接报错:java.sql.SQLException:null,message from server:"Host '27,45,38,132' is not allowed to conn


相关文章:

  • 2021-07-17
  • 2021-09-14
  • 2022-12-23
  • 2021-05-16
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2021-12-11
猜你喜欢
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2021-04-26
  • 2021-08-02
  • 2022-01-07
  • 2022-12-23
相关资源
相似解决方案