连接失败!null, message from server: “Host ‘xxxx‘ is not allowed to connect to this MySQL server“
连接数据库。
mysql -u账号 -p密码
show databases;
use root; //选择需要改的用户
select user,host from user; //可以看到user为root,host为localhost的话,说明mysql只允许本机连接,那么外网,本地软件客户端就无法连接了。
update user set host = '%' where user='root';
flush privileges; //刷新权限