Skip navigation links

MySQL Forums :: Install & Repo :: Error 2003 (HY000): Can't connect to MySQL server on...


Advanced Search

Re: Error 2003 (HY000): Can't connect to MySQL server on...
Posted by: Stephen Adkins ()
Date: November 26, 2007 03:26PM

This error happened for me also.

ERROR 2003 (HY000): Can't connect to MySQL server on 'po51' (111)

Clearly this is a networking-level error and not a MySQL authentication error.

The simple answer was to comment out the "bind-address" line in the global "my.cnf".

I am running a fresh install of Gentoo.

# cat /proc/version
# Linux version 2.6.22-gentoo-r9 (root@po51) (gcc version 4.1.1 (Gentoo 4.1.1-r3)) #2 SMP Sun Nov 18 20:24:03 EST 2007

I checked my global "my.cnf" (which on Gentoo is "/etc/mysql/my.cnf") and saw
these lines.

# security:
# using "localhost" in connects uses sockets by default
# skip-networking
bind-address = 127.0.0.1

The "skip-networking" is commented out meaning that we are not skipping networking. That's good for me because I want to connect to the MySQL server from another machine.

The "bind-address" line says that when the server binds to a socket and listens on it, it will only access networking connections from clients that connect to it on that IP address. This is not what I wanted because "127.0.0.1" is the IP address for "localhost". This configuration will inherently not allow anyone to connect to the MySQL server from any other server!

Others have suggested changing "127.0.0.1" to the network address that the server takes on the network ("172.17.4.51" in my case). This should work. However I do not wish to be this specific. So I commented out the "bind-address" line completely, and it started working just fine.

There is no loss in security from commenting out this line. If someone is on your network trying to connect to the MySQL server, you will be no safer if the line exists than if it is commented out.

Stephen Adkins

Options: ReplyQuote


Subject Written By Posted
Error 2003 (HY000): Can't connect to MySQL server on... mikeaconway 11/26/2004 03:38PM
Re: Error 2003 (HY000): Can't connect to MySQL server on... mikeaconway 11/29/2004 04:00PM
Re: Error 2003 (HY000): Can't connect to MySQL server on... Zeke Ricci 09/25/2005 02:06PM
Re: Error 2003 (HY000): Can't connect to MySQL server on... Tien Ngoc 01/19/2007 12:48AM
Re: Error 2003 (HY000): Can't connect to MySQL server on... Warren Sangster 10/13/2007 06:45AM
Re: Error 2003 (HY000): Can't connect to MySQL server on... Kari Jääskeläinen 10/27/2007 06:30AM
Re: Error 2003 (HY000): Can't connect to MySQL server on... shailesh dhumal 11/15/2007 02:22AM
Re: Error 2003 (HY000): Can't connect to MySQL server on... Stephen Adkins 11/26/2007 03:26PM
Re: Error 2003 (HY000): Can't connect to MySQL server on... hancang zhou 08/06/2008 12:35AM
Re: Error 2003 (HY000): Can't connect to MySQL server on... Ding 06/13/2008 12:26AM
Re: Error 2003 (HY000): Can't connect to MySQL server on... Mark Guadalupe 09/24/2008 11:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.