Page 1 of 1

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

Posted: Fri Sep 12, 2008 9:35 am
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?

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

Posted: Fri Sep 12, 2008 11:33 am
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.

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

Posted: Fri Sep 12, 2008 12:42 pm
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

Can't connect to database

Posted: Sat Sep 13, 2008 9:55 am
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

Posted: Tue Sep 16, 2008 6:45 pm
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.

Can't connect to host

Posted: Tue Sep 16, 2008 10:34 pm
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.