Skip to content

Instantly share code, notes, and snippets.

@tarex
Forked from salcode/dump-mamp-mysql-dbs.sh
Last active July 18, 2016 18:00
Show Gist options
  • Save tarex/eba32e4f3e34b0bd1c81 to your computer and use it in GitHub Desktop.
Save tarex/eba32e4f3e34b0bd1c81 to your computer and use it in GitHub Desktop.
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment