Linux服务器下Can't connect to MySQL server on '' (10060) (转)
远程连接服务器出现以上错误,解决后做了下总结,如有不正之处,请指正。
主要有三个原因:
1、mysql授权表里没有远程机器的权限,及需要在授权表mysql.user添加
grant all privileges on *.* to 'root'@'远程登陆IP' identified by '远程登陆密码'
flush privileges;
2、网络不通,这个就不说了。
3、防火墙禁止3306端口,以iptable为例
vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306-j ACCEPT
service iptables restart
ps: iptables设置
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
本文总结了远程连接Linux服务器MySQL时遇到的“Can't connect to MySQL server on ''(10060)”错误的原因及解决方案,包括权限配置、网络状况检查及防火墙设置等关键步骤。
1122

被折叠的 条评论
为什么被折叠?



