连接失败!null, message from server: “Host ‘xxxx‘ is not allowed to connect to this MySQL server“
- 连接数据库,这里以默认用户名密码为例
- mysql -uroot -proot
- show databases;
- use mysql ;
- select user,host from user;//可以看到user为root,host为localhost的话,说明mysql只允许本机连接,那么外网,本地软件客户端就无法连接了。
- update user set host = ‘%’ where user=‘root’;
- flush privileges;//刷新权限
还没有评论,来说两句吧...