2003 Can't connect to MySQL server on '124.221.222.175' (0)
这个错误的最常见原因就是防火墙没关。
1.linux
如果是虚拟机上面的linux的MySQL可以先通过下面代码查看linux防火墙的状态
systemctl status firewalld
//[root@VM-4-2-centos ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service;
disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
如果是是运行的状态就关闭防火墙进行尝试
systemctl stop firewalld #关闭防火墙
然后在去尝试远程连接。如果还是出现问题,看下面红色的错误码
1.1 错误号码1130 Host '192.168.100.1' is not allowed to connect to this MySQL server
参考这个文章https://blog.csdn.net/hong17634483932/article/details/126128795?spm=1001.2014.3001.5501
1.2 错误号码 2058 Plugin caching_sha2_password could not be loaded: Xg
参考这个文章https://blog.csdn.net/hong17634483932/article/details/126128795?spm=1001.2014.3001.5501
2.腾讯云服务器linux
上面同样的过程操作一下,如果还是报错,那么就在腾讯云服务器的控制台里面找到你的服务器实例里面的防火墙管理,加一个MySQL3306的端口。
首页
最后样板