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

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

Mysql报错"Host '27,45,38,132' is not allowed to connect

二、输入:show tables;

Mysql报错"Host '27,45,38,132' is not allowed to connect

三、输入:select host from user;

Mysql报错"Host '27,45,38,132' is not allowed to connect

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

Mysql报错"Host '27,45,38,132' is not allowed to connect

五、修改完成后,sudo systemctl restart mysqld重启mysql服务就生效。 

相关文章:

  • 2021-08-13
  • 2021-08-04
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-11
  • 2021-12-09
  • 2021-09-27
相关资源
相似解决方案