ERROR 1130 (HY000): Host 'wyc-server' is not allowed to connect to this MySQL server
百度了一天,没解决,我都吐了!!
1,检查防火墙是否打开,并查看状态
systemctl start firewalld
systemctl status firewalld
2.firewall-cmd --add-port=3306/tcp 打开 你需要的端口号
3.输入一下命令
mysql -u root -p
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>flush privileges;
mysql>select host, user from user;
4.quit退出mysql,并重启mysql
service mysqld restart
5.重新尝试登录一下
mysql -uroot -pxxxxx -h ip地址 -P 3306
最后发现登陆成功。