Archive | January 7, 2009

PHP on OSX: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

When installing PHP and MySQL on OSX  you may get the error Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’.  Or you may also get “No such file or directory” when calling mysql_connect from a PHP page.  This occurs because PHP is looking for the file mysql.sock in it’s typical installation location of /var/mysql/mysql.sock. [...]

13 Comments Continue Reading →