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

这里写图片描述

作者:itmyhome


本文转载:CSDN博客