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

来源:互联网 发布:windows病毒 编辑:程序博客网 时间:2024/05/22 06:38

远程连接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 -prootmysql> user mysql;mysql> update user set host = '%' where user = 'root';mysql> flush privileges;

这里写图片描述

作者:itmyhome

0 0