I have had this problem all of the sudden after cloneing another drupal project to my desktop. But even after I delete the other drupal installation i still get this error

PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in lock_may_be_available() (line 167 of /Applications/MAMP/htdocs/ESD-Opportunity/docroot/includes/lock.inc).

I am running aquia desktop as well as MAMP. And here is what is in my settings.php file

$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'suny_global',
'username' => 'root',
'password' => 'root',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);

I have tried switching "localhost" to "127.0.0.1" with no luck.

I cannot run any drush commands except status for which i get

Drupal version : 7.41
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database port :
Database username : root
Database name : suny_global
PHP executable : /Applications/DevDesktop/php5_6/bin/php
PHP configuration : /Applications/DevDesktop/php5_6/bin/php.ini
PHP OS : Darwin
Drush script : /Applications/DevDesktop/drush/vendor/drush/drush/drush.php
Drush version : 8.0.0
Drush temp directory : /tmp
Drush configuration : /Applications/DevDesktop/drush/vendor/drush/drush/drushrc.php
Drush alias files : /Users/philip.rudy/.drush/nysesdopportunities.aliases.drushrc.php
/Users/philip.rudy/.drush/nysglobal.aliases.drushrc.php /Users/philip.rudy/.drush/nysstartup.aliases.drushrc.php
/Users/philip.rudy/.acquia/DevDesktop/Drush/Aliases/aliases.drushrc.php
Drupal root : /Applications/MAMP/htdocs/ESD-Opportunity/docroot
Site path : sites/default

Please help

Comments

alifani’s picture

Hey, 

I am getting same error, did you solve it?

Thanks 

AF