Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have since upgrade to MAMP 1.9 and Drush 3.3. Everything worked fine prior but now I notice I cannot perform mysqldump commands using drush sql-dump.
I get back an error sh: mysqldump:unable to find command.
I believe this is to do with where the socket for mysql is but I could be wrong. I am also getting some PDO issues at times but I will deal with that later.
Does anyone have any ideas? I am running Mamp and Apache on their default ports, not MAMP ports.
Any help would be greatly appreciated.
Comment | File | Size | Author |
---|---|---|---|
#17 | mamp-sql-docs.patch | 739 bytes | greg.1.anderson |
Comments
Comment #1
jaymiejones86 CreditAttribution: jaymiejones86 commentedI may aswell add the PDO issues which may be related on second thoughts
This appears when performing a drush status while in the root directory of a drupal install (drupal 6). That message comes up before the status information.
Comment #2
Chris CharltonI saw this error too. Sometimes I forget to launch MAMP first, which may have been the case for you too? I would suggest downloading the latest Drush, even the DEV or HEAD edition.
Comment #3
jaymiejones86 CreditAttribution: jaymiejones86 commentedHi Chris,
Unfortunately all of your suggestions did not work. Really not too sure whats going on but I may believe it has something to do with MAMP's configuration of MySQL. But I thought that Drush should be able to find the location of these required scripts, eg like mysqldump.
Comment #4
fallsemo CreditAttribution: fallsemo commentedBased on that error message, I would create a sym from that directory to the location of MAMP's mysql.sock
See: https://drupal.org/node/251837#comment-906520
Comment #5
jaymiejones86 CreditAttribution: jaymiejones86 commentedThanks fallsemo. That fixed that issue but I still cannot perform a
drush sql-dump > example.sql
as even with the symlink, MySQL cannot find mysqldump...anyone else have any ideas? I know I can always use backup and migrate but this still could become an issue with other things later on. Hopefully there will be a fix for something like this in Drush someday...Comment #6
greg.1.anderson CreditAttribution: greg.1.anderson commentedIt's the shell that can't find mysqldump, not MySQL. Make sure that the executable is in your PATH.
Comment #7
jaymiejones86 CreditAttribution: jaymiejones86 commentedThanks greg.1.anderson. How would I go about that the best way?
Comment #8
greg.1.anderson CreditAttribution: greg.1.anderson commentedIn .bash_profile:
Comment #9
jaymiejones86 CreditAttribution: jaymiejones86 commentedThanks again greg.1.anderson but still getting the error:
sh: mysqldump:unable to find command.
I tried everything to make sure it was there but still didnt help...hmmm back to the drawing board.
Comment #10
jaymiejones86 CreditAttribution: jaymiejones86 commentedThanks again greg.1.anderson but still getting the error:
sh: mysqldump:unable to find command.
I tried everything to make sure it was there but still didnt help...hmmm back to the drawing board.
Comment #11
moshe weitzman CreditAttribution: moshe weitzman commentedat this point, drush is not the issue. closing.
Comment #12
jwhat CreditAttribution: jwhat commentedThis worked, thanks.
The actual command I used was:
ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
Comment #13
benleivian CreditAttribution: benleivian commentedThanks jwhat, I got mine to work via:
sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
Comment #14
lucor CreditAttribution: lucor commented#13 works for me. Thanks!
Comment #15
seandunaway CreditAttribution: seandunaway commented#13 works!
Comment #16
joshmiller#13 worked :) Thank God!
Comment #17
greg.1.anderson CreditAttribution: greg.1.anderson commented#13 is based off of the post referenced in #4, which is from 2008, but we still have a steady stream of people coming to this issue from google to solve their problems. Maybe a couple of lines in README.txt would be in order?
Patch attached.
Comment #18
moshe weitzman CreditAttribution: moshe weitzman commentedFor Drupal 7, we just added support for an alternate location for your unix socket. we might want to mention that too, but this topic gets complex quickly so perhaps the patch is fine as is.
Comment #19
johnnydarkko CreditAttribution: johnnydarkko commentedThanks belleivian! worked for me! Also fixed another issue I was having: I was running drush cc all and it kept on saying that I needed a higher bootstrap. After I used your solution, everything seems to be cleared up now. THANKS AGAIN!
Comment #20
moshe weitzman CreditAttribution: moshe weitzman commentedCommitted to master. Does not apply cleanly to 4.x
Comment #22
cedeweyfyi- for those running into similar problems with XAMPP on MAC OSX, run these corresponding commands
Comment #23
mahtoranjeet CreditAttribution: mahtoranjeet commentedFor MAMP below commands working fine for me
sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock