Drush and mysql database (with MAMP) connection problem I have a problem running some drush methods involving database connection. 
I run the free version of MAMP.

If I run methods like si or pml I get no problems

But if I run the drush archive-dump method I get this error message:

Database dump failed.


look the capture:
The problem seems to be in mysql.sock location. I found a solution from here: 
http://www.razorsql.com/docs/support_mysql_mac_mamp.html

Short answer


  One way to change the socket location is to edit the MAMP start and stop scripts so that the mysql.sock location is the default. This can be done by editing the following files:
  
  /Applications/MAMP/bin/startMysql.sh
  
  /Applications/MAMP/bin/stopMysql.sh
  
  Replace
  
  socket=/Applications/MAMP/tmp/mysql/mysql.sock
  
  with
  
  socket=/tmp/mysql.sock 


How I solved the problem

I did

drush ard -v


to see what was going on.

Executing: mysqldump --result-file /tmp/drush_tmp_1352892897_50a381e13a71d/... --no-autocommit --single-transaction --opt -Q  ... --host=localhost --user=... --password=...
Database dump failed. 


So I copied the mysqldump command and copied it to the command line and hit enter.

mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect.


After this I tried several methods to solve the socket issue after I found the solution from www.razorsql.com.