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

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

解决方法:

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

mysql -u root -proot
mysql> user mysql;
mysql> update user set host = '%' where user = 'root';
mysql> flush privileges;

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

作者:itmyhome

05-11 22:28