centOS7中Host is not allowed to connect to this MySQL server解决方法

安装好mysql并打开端口后,远程连接mysql,报错Host is not allowed to connect to this MySQL server

是因为centOS中的MySQL不允许远程连接

解决办法:

  • 登录MySQL     mysql -u root -p密码
  • 执行 use mysql
  • 执行update user set host ='%' where user = 'root';执行会报错,不影响结果
  • 执行flush privileges;

猜你喜欢

转载自blog.csdn.net/weixin_38503726/article/details/85231873
今日推荐