You are not logged in.

#1 2011-02-25 15:31:38

mschu
Member
Registered: 2009-03-13
Posts: 16
Website

[solved] MySQL connect works on localhost but not 127.0.0.1

Hi,
I'd appreciate if someone could give me a hint on how to connect to a mysql server on 127.0.0.1 instead of localhost.

AFAIK, these should be routed identically and no additional TCP layer should be created when using the IP.

$ mysql -u root -h localhost -D test # works
$ mysql -u root -h 127.0.0.1 -D test # does not work

127.0.0.1 does map to localhost/vice versa

I have no idea why this is. The table permissions are set to include both.

Last edited by mschu (2011-02-25 17:08:51)

Offline

#2 2011-02-25 17:08:29

mschu
Member
Registered: 2009-03-13
Posts: 16
Website

Re: [solved] MySQL connect works on localhost but not 127.0.0.1

Answer from superuser.com:

The MySQL client library overrides localhost to use a Unix socket instead of a TCP/IP connection to 127.0.0.1. If you can connect to localhost but not 127.0.0.1, that suggests that it's either firewalled or not listening on 127.0.0.1.

Offline

Board footer

Powered by FluxBB