ERROR 2003 (HY000): Can ' t connect to MySQL Server

Source: Internet
Author: User

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

Disclaimer: This document can be changed at will, but must be signed by the original author

Phoenix Dancer qq:578989855

ERROR 2003 (HY000): Can ' t connect to MySQL Server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.