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
  • Save forsgren/7769cb6e61f0f40d76ac702eb1dec5ab to your computer and use it in GitHub Desktop.
Save forsgren/7769cb6e61f0f40d76ac702eb1dec5ab 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment