MySQL Forums
Forum List  »  Install & Repo

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




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.