Created
April 10, 2015 02:01
-
-
Save aaronthorp/aeba5403bdb038844021 to your computer and use it in GitHub Desktop.
Dump all MySQL to seperate files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/db && mysql -s -r -u root -p{Secret} -e 'show databases' | while read db; do mysqldump -u root -p{Secret} $db -r ~/db/${db}.sql; [[ $? -eq 0 ]] && gzip ~/db/${db}.sql; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment