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;

posted @ 2019-06-27 17:56  死神敲键  阅读(283)  评论(0编辑  收藏  举报