Can't connect to server through socket '/tmp/mysql.sock'

Having trouble installing serendipity?
Post Reply
hstoellinger
Posts: 4
Joined: Fri Sep 12, 2008 9:26 am

Can't connect to server through socket '/tmp/mysql.sock'

Post by hstoellinger »

I have MySQL running with a number of databases (including that of the Seagull PHP-Framework as well as "private" ones). Now, trying to install Serendipity on top of that I get the above message. I have got "/var/lib/mysql/mysql.sock"specified in my.cnf and that works fine with the existing DBs. Any ideas?
hstoellinger
Posts: 4
Joined: Fri Sep 12, 2008 9:26 am

Can't connect to server through socket '/tmp/mysql.sock'

Post by hstoellinger »

To clarify further: /var/lib/mysql/mysql.sock is specified for both [mysqld] daemon AND [client]. And, as I mentioned in the original post, this works just fine for all the other clients (eg. OpenOffice Base as well as the Seagull-PHP-Framework). Any help is appreciated.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Can't connect to server through socket '/tmp/mysql.sock'

Post by garvinhicking »

Hi!

I don't know how seagull works, maybe it uses the PHP commandline client or a different MySQL Library (PDO?). s9y uses mysql(i) extensions, which can have compile-time settings for the PHP module that specify a different socket.

The setting in your my.cnf is unrelated to that, the socket is specified through php.ini usually.

You could try to access the host via IP, by using the IP instead of "localhost".

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
hstoellinger
Posts: 4
Joined: Fri Sep 12, 2008 9:26 am

Can't connect to database

Post by hstoellinger »

Hello Garvin,
Many thanks for your advice. I put /var/lib/mysql/mysql.sock into my php.ini. That did not cure the problem. Then I tried your second advice - I specified 127.0.0.1 instead of "localhost" when installing serendipity - and that did the trick. I want to test serendipity within the Seagull OO-PHP-framework as an internal discussion forum for my brassband. I am trying to create a kind of "virtual office" for it, besides the usually publicity-oriented web portals in this scene.
Regards and greetings from Salzburg
claudermilk
Regular
Posts: 9
Joined: Sat Sep 06, 2008 3:55 am

Post by claudermilk »

If "localhost" does not work and 127.0.0.1 does, sounds to me like there's a missing entry in your hosts file. AFAIK, that one is typically there by default. I'll bet if you put it back in localhost would work again.
hstoellinger
Posts: 4
Joined: Fri Sep 12, 2008 9:26 am

Can't connect to host

Post by hstoellinger »

the following entries in connection with localhost are in /etc/hosts:
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
I also use localhost:8080 for local testing of a website which I am setting up at the moment. And that works just fine.
Post Reply