[NBLUG/talk] MySQL connection problem

Troy Arnold troy at zenux.net
Sat Feb 19 12:39:33 PST 2005


On Sat, Feb 19, 2005 at 10:08:51AM -0800, Peter Lutz wrote:
> Good Morning.
> 
> I don't use MySQL much, but I do have it installed on a Debian testing box.
> It seems to work just fine after an upgrade from 3.23 to 4.0.23, on the 
> server.
> The problem is on a client.  When trying to connect,
> shell>mysql -h<HOSTNAME> -u<USERNAME> -p
> I get the error message:
> ERROR 2003: Can't connect to MySQL server on 'host_name' (111)
> 
> The /etc/mysql/my.cnf file for 3.23 had a line containing:
> #  skip-networking

Looking at the default debian testing my.cnf shows:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1

So, add a bind-address line for your local net interface on the server and
restarting mysql should do it.
bind-address = 192.168.1.50

You can test if mysqld is listening on that interface by (from the
client):
telnet 192.168.1.50 3306

You should either get a connection refused or the server part of the
mysqld handshake, something like:
Trying 192.168.1.50...
Connected to 192.168.1.50.
Escape character is '^]'.
4
4.0.23_Debian-4-logmlYX/"Z~,

If the server is listening but you still cannot connect from the client,
then the problem would seem to be with your grant tables.

-troy




More information about the talk mailing list