Skip to content

Instantly share code, notes, and snippets.

@salcode
Created February 21, 2014 20:30

Revisions

  1. salcode created this gist Feb 21, 2014.
    5 changes: 5 additions & 0 deletions dump-mamp-mysql-dbs.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@

    # 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