远程连接Mysql报错 java.sql.SQLException:null,message from server ... is not allowed to connect 在MySQL命令行输入如下命令: use mysql; select host from user; update user set host ='%' where user ='root'; 然后重启MySQL服务。