Skip to content

Instantly share code, notes, and snippets.

@salcode
Created February 21, 2014 20:30
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save salcode/9142815 to your computer and use it in GitHub Desktop.
Save salcode/9142815 to your computer and use it in GitHub Desktop.
Shell Script to dump all MAMP DBs into separate files
# based on http://www.commandlinefu.com/commands/view/2916/backup-all-mysql-databases-to-individual-files
# but modified for the MAMP path and to include default root/root as username and password
for I in $(/Applications/MAMP/Library/bin/mysql -u root -proot -e 'show databases' -s --skip-column-names); do /Applications/MAMP/Library/bin/mysqldump -u root -proot $I | gzip > "$I.sql.gz"; done
@blackforestcode
Copy link

Thanks, had to do this today and it worked fine! 😊

@Luckyfella73
Copy link

Thanks for sharing - very helpfull!

@zecka
Copy link

zecka commented Feb 8, 2021

Thank's, you save 1 hour of my life :)

@adampatterson
Copy link

Thanks!

@Colir
Copy link

Colir commented Sep 15, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment