MySQL远程连接:Host 'x' is not allowed to connect to this MySQL server

电玩女神 2022-07-28 00:05 124阅读 0赞

远程连接MySQL时发现如下错误:

  1. java.sql.SQLException: null, message from server: "Host '192.168.30.23' is not allowed to connect to this MySQL server"

解决方法:

进入MySQL的bin目录,执行如下命令:

  1. mysql -u root -proot
  2. mysql> user mysql;
  3. mysql> update user set host = '%' where user = 'root';
  4. mysql> flush privileges;

这里写图片描述

作者:itmyhome

发表评论

表情:
评论列表 (有 0 条评论,124人围观)

还没有评论,来说两句吧...

相关阅读