if drush cannot connect to the database and needs a higher bootstrap level to continue.

link to original post

"The only way to make it work is to add the unix_socket line to my Drupal settings.php files for all my projects:"

$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'site',
'username' => 'user',
'password' => 'pass',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
),
),
);