远程连接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;

License Badge