06 June 2006

If you are running php, and get the following error trying to connect to an MySQL database

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /server/web/path/common/mysql.class.php on line 40
2002 : Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)



Check your php.ini file for the following line and make sure it points to the correct MySQL socket file:

mysql.default_socket = /var/lib/mysql/mysql.sock

No comments: