【转】连接失败!null, message from server: “Host ‘xxxx‘ is not allowed to connect to thi

497 阅读1分钟

连接失败!null, message from server: “Host ‘xxxx‘ is not allowed to connect to this MySQL server“

转自:blog.csdn.net/qq_43571415…

  • 连接数据库,这里以默认用户名密码为例
  • 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;//刷新权限