Skip to content

Instantly share code, notes, and snippets.

@forsgren
Forked from salcode/dump-mamp-mysql-dbs.sh
Created January 11, 2022 20:40
Show Gist options
  • Select an option

  • Save forsgren/7769cb6e61f0f40d76ac702eb1dec5ab to your computer and use it in GitHub Desktop.

Select an option

Save forsgren/7769cb6e61f0f40d76ac702eb1dec5ab to your computer and use it in GitHub Desktop.

Revisions

  1. @salcode 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