Created
September 28, 2017 00:59
-
-
Save oleksii-zavrazhnyi/f152f97de5f8e0962b187d718016bfd4 to your computer and use it in GitHub Desktop.
Dump all MySQL databases in separate files
This file contains 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
export PASSWORD="" | |
mysql -uroot -p$PASSWORD -e 'show databases' | while read dbname; do mysqldump -uroot -p$PASSWORD --complete-insert --some-other-options "$dbname" > "$dbname".sql; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put your mysql password in first line