I. Question-making
/usr/local/webserver/mysql/bin/mysql-u root-h 172.29.141.112-p-s/tmp/mysql.sock
Enter Password:
ERROR 2003 (HY000): Can ' t connect to MySQL server on ' 172.29.141.112 ' (113)
Two. Analysis of the problem
These problems may occur in the following ways
1. skip-networking is configured in the MY.CNF configuration file
Skip-networking This parameter, so that all TCP/IP ports are not listening, that is, the native, other clients can not connect to the MySQL server network
So you need to comment out this parameter.
2.configuration of bindaddress parameters in the my.cnf configuration file
Bindaddress, there are bind-address, this parameter is to specify which IP addresses are configured so that the MySQL server only responds to which IP address requests, so this parameter needs to be commented out.
3. Causes of firewalls
Shut down the firewall by/etc/init.d/iptables stop
My problem is caused by this reason. Shutting down the MySQL server's firewall is ready to use.
Three. Resolution of the problem
1. If this is the first reason above, then find my.cnf, comment out skip-networking this parameter
Sed-i ' s%skip-networking% #skip-networking%g ' my.cnf
2. If this is the second reason above, then find my.cnf, comment out bind-address this parameter
Sed-i ' s%bind-address% #bind-address%g ' my.cnf
Sed-i ' s%bindaddress% #bindaddress%g ' my.cnf
It is best to review this parameter.
3. If this is the third reason, shut down the firewall or configure it accordingly
/etc/init.d/iptables stop
Four. Reference
Http://hi.baidu.com/vbkan/blog/item/cd5035030cefee793812bb56.html
Http://dev.firnow.com/course/7_databases/mysql/myxl/20090820/169010.html
Http://www.dnbcw.com/biancheng/sql/lojz182597.html
This article from "Nicol Lock Silk Sorrow" blog, please make sure to keep this source http://smoke520.blog.51cto.com/9256117/1792903
ERROR 2003 (HY000): Can ' t connect to MySQL Server