Tuesday, 31 May 2011

PHP FIXED: mysql_error() 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

If you are seeing the error above while running PHPUnit in Zend Studio, then I suggest you follow what I do. Here is my setup by the way: Ubuntu 11.04, Mysql 5.1.54.

Solution:

Just make a symbolic link from your mysql.sock to the directory it is looking:

ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

No comments:

Post a Comment