Greetings folks,
If you've got this error using Mac OS X with a MySQL server already installed (not using MAMP), have a look to:
http://support.apple.com/kb/TS1999?viewlocale=en_US
You should have to change the mysql.default_socket settings in the php.ini file.
For instance :
mysql.default_socket=/tmp/mysql.sock
Best
Claude