can't connect to mysql server on localhost(10060)
程序员文章站
2022-05-01 21:51:43
...
问题原因:
导致些问题可能有以下几个原因:
1、网络不通;
2、服务未启动;
3、防火墙端口未开放;
解决方法:
启动服务:
service mysqld start;
经过分析,我遇到的这个问题是防火墙导致的!
开放防火墙端口
添加需要监听的端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
保存设置
/etc/init.d/iptables save
查看状态
/etc/init.d/iptables status
临时关闭防火墙服务
service iptables stop
开启防火墙服务
service iptables start
开机不再启动防火墙服务
chkconfig iptables off
推荐阅读
-
连接Mysql提示Can’t connect to local MySQL server through socket的解决方法
-
MYSQL ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.10.210' (111) 解决方法
-
MySQL连接错误:Can't connect to MySQL server on'localhost' (10055)
-
MySQL错误 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 的解决办法
-
windows 连接 linux 上的mysql出现Can't connect to; is not allowed to connect;Access denied for user
-
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)解决办法
-
Can't connect to local MySQL server through socket
-
Can't connect to MySQL server on 'localhost' (10061)问题描述及解决办法
-
MySQL问题记录——2003-Can't connect to MySQL server on 'localhost'(10038)
-
Can’t connect to MySQL Server情况分析和解决