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(): [2002] 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!
Topics:
Posted on May 29, 2012 at 11:42am
Comments
You saved me a lot time with this DRUSH error on MAMP set up
Thanks for this! It really helped. :) Paul
Thanks
Thanks for taking the time and posting this solution. I looked in Drupal.org with no luck.
Thank you!
Agreed, total time-saver! Thanks so much.
Works with XAMPP too
sudo mkdir /var/mysql
sudo ln -s /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock /var/mysql/mysql.sock
Thanks!
Thank you so much.
Thank you so much.
Yeah command line!
Thanks a million. You saved my morning, my day and ultimately my sanity.
worked like a charm
Thanks. That was perfect.
Thx !
Thank you, saved my life :)
Thanks
Thanks, fixed it for me too!
Many Thanks
This worked perfectly. I'm not sure if it was due to an upgrade or what as Drush had been working on my setup before. Again, thanks and kudos.
It works in YII too, thank
It works in YII too, thank you so much
Thank you sooo much!!
This worked like a charm. I am so thankful that I came across your solution.
I love you. thank you. drupal
I love you. thank you. drupal updates with svn are a nightmare without drush.
Thanks for posting this!
Thanks for posting this!
Thanks!
I always love googling a problem and finding an answer from a friend :-)
Add new comment