安裝好mysql并打開端口後,遠端連接配接mysql,報錯Host is not allowed to connect to this MySQL server
是因為centOS中的MySQL不允許遠端連接配接
解決辦法:
1、登入MySQL mysql -u root -p密碼
2、執行 use mysql
CentOS7中Host is not allowed to connect to this MySQL server解決方法 3、執行update user set host =’%’ where user = ‘root’;執行會報錯,不影響結果
CentOS7中Host is not allowed to connect to this MySQL server解決方法
CentOS7中Host is not allowed to connect to this MySQL server解決方法 4 、執行flush privileges;
CentOS7中Host is not allowed to connect to this MySQL server解決方法 5、更改成功
CentOS7中Host is not allowed to connect to this MySQL server解決方法