天天看点

2003- Can't connect MySQL Server on 'xxx' (10060 "Unknown error") linux oneinstack

2003- Can't connect MySQL Server on 'xxx' (10060 "Unknown error") linux oneinstack

解决办法 :

1)查看哪些端口被打开 netstat -anp

2003- Can't connect MySQL Server on 'xxx' (10060 "Unknown error") linux oneinstack

127.0.0.1:3306 -- 指mysql数据库仅能在本地下访问;

2)我们把127.0.0.1:3306改为0.0.0.0:3306,这样才能让所有用户可以远程访问mysql数据库;

2003- Can't connect MySQL Server on 'xxx' (10060 "Unknown error") linux oneinstack

(mysql5.7.24版本,配置文件目录是:/etc/mysql/mysql.conf.d/mysqld.cnf)

2003- Can't connect MySQL Server on 'xxx' (10060 "Unknown error") linux oneinstack

重启生效;

命令:service mysql restart

2)检查阿里云服务器的安全组3306端口是否放开

2003- Can't connect MySQL Server on 'xxx' (10060 "Unknown error") linux oneinstack

如果没有,就增加这个规则

2003- Can't connect MySQL Server on 'xxx' (10060 "Unknown error") linux oneinstack

继续阅读