您的位置:首页 > 博客中心 > 数据库 >

Can‘t connect to MySQL server on ‘IP‘ (10060)

时间:2022-03-14 00:20


配置iptables,使他容许3306的访问

加入下面脚本...问题消失了(直接在命令行界面执行下面语句):

iptables -I INPUT -p tcp --dport 3306 -j ACCEPT;  //访问本机的3306的端口的数据包都允许(进口)

iptables-save;  //保存该脚本

service iptables save;   //保证重启后脚本还能生效

iptables -I OUTPUT -p tcp --sport 3306 -j ACCEPT;  //把3306改为源端口(出口)

iptables-save;

service iptables save;

service iptables restart


热门排行

今日推荐

热门手游