I just set up a new MAMP environment on my Mac using MAMP Pro 2. When running any Drush commands that required a database, I kept getting this error in the Terminal:
PDO::__construct():  No such file or directory (trying to [warning] connect via unix:///var/mysql/mysql.sock) environment.inc:517
This post over at drupal.stackexchange.com provided the solution:
sudo mkdir /var/mysql sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
Worked like a charm -- Drush functions again!
Posted on May 29, 2012 at 11:42am