Web Hosting Talk







View Full Version : MySQL Connection Problems


pauljones_2
12-16-2003, 01:30 PM
I have a single RAQ550 box which I have upgraded for use with PHP and MySQL so that I can host PostNuke web sites.

Everything was working Ok until last Friday when I installed an Apache and MySQL patch from Sun. Ever since then, the PostNuke sites are saying that they are having a problem connecting to MySQL.

When I log into the box and try to view the database I get the following error -

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect

I think the MySQL update has emptied the /tmp directory.

The mysql.sock file is now in ./var/lib/mysql/

I have done some reading around the net and found that you can change the location of this file in the my.conf file but by box does not have this file anywhere.

Am I heading in the right direction or do you think the problem lies elsewhere?

Any help would be much appreciated. My linux knowledge is a bit lacking.

Thanks

benwell
12-16-2003, 09:08 PM
I have a fix for this. If you like to email me support@cobalt-server.co.uk i will send you a fix file

huck
12-17-2003, 02:52 PM
This is due to where you program is looking for mysql.sock.

The mysql.sock is probably created in /var/lib/mysql while your program is looking into /tmp.

You can simply symlink /tmp/mysql.sock to /var/lib/mysql.sock

Benwell --- what is your file fix? init script change?

benwell
12-17-2003, 02:55 PM
its just a simple change in php.ini to tell php where mysql is located

huck
12-17-2003, 02:58 PM
I prefer the symlink solution as some scripts may explicity set the mysql.sock path. If you switch the php.ini, you may break other scripts. Of course, if you know this will not be a problem then the php.ini is a better solution.

pauljones_2
12-17-2003, 05:46 PM
Thanks for the responses but the modified php.ini file had no effect. The website still can't connect to the database.

Any other idea's?

Steven
12-23-2003, 08:44 PM
pm me if u still need assitence

benwell
12-23-2003, 08:46 PM
I have sorted this issue for Paul and works fine now.

This topic is closed