null, message from server: "Host '192.168.2.122’ is not allowed to connect to this mysql server

apache发布时遇到的问题:

null, message from server: "Host '192.168.0.128’ is not allowed to connect to this mysql server

vi /etc/my.cnf

#skip-grant-table注释取消

:wq

保存退出
2.
进入mysql

cd /路径

登录:

mysql -u root -p123456

使用:

use mysql

查看权限:

select user,host from user;

此时查看user中root所对应的host对应更新:

update user set user.host=’%’ where user.user=‘root’;

flush privileges

;更新权限

ALTER USER root IDENTIFIED WITH mysql_native_password BY ‘123456’;

flush privileges;

exit;

vi /etc/my.cnf

#skip-grant-table注释

:wq

保存退出

Linux真是操作起来每个人情况都不一样==

你可能感兴趣的:(linux,mysql,apache)