[SWLUG] PHP and the MySQL socket file

Peter Bradley P.Bradley at dsl.pipex.com
Sat Sep 23 20:01:12 UTC 2006


I've just upgraded MySQL to version 5, using the binary installation 
from the MySQL web site.  Everything works fine except for PHP5.

The problem is that following the reinstallation of MySQL, the 
mysql.sock file is no longer in /var/lib/mysql/mysql.sock.  It's now in 
/tmp/mysql.sock; but the PHP5 mysql and mysqli extensions are still look 
for it in the original location (according to phpinfo()).  I tried 
altering php.ini as follows:

mysql.default_socket = /tmp/mysql.sock

... but this doesn't seem to have made any difference.

I've also created a /etc/my.cnf file containing the following:

[client]
socket=/tmp/mysql.sock

This doesn't seem to do any good either.

Does anyone know how to tell php where to look for the mysql.sock file?

Cheers


Peter




More information about the Swlug mailing list