Saturday, April 7, 2012

PDO Connection Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Error

PDO Connection Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)


Solution

For me it was a misspelling in mysql my.cfg

Changed socket configuration from


socket        = /tmp/mysqld.sock

to

socket        = /tmp/mysql.sock   #this is the installation default


No comments:

Post a Comment