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

深碍√TFBOYSˉ_ 2023-02-26 07:27 134阅读 0赞
  • 连接数据库,这里以默认用户名密码为例
  • 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;//刷新权限

发表评论

表情:
评论列表 (有 0 条评论,134人围观)

还没有评论,来说两句吧...

相关阅读