Created
November 10, 2019 12:40
-
-
Save sfnprg/02e5d237e26d01245713be7a135d72e9 to your computer and use it in GitHub Desktop.
mysqldump all available databases
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
mysql -s -r --user <USER> --password=<PASSWORD> -e 'show databases' | while read db; do mysqldump --user <USER> --password=<PASSWORD> $db | gzip > <SERVER_PATH>/export/${db}_$(date +%Y%m%d-%H%M%S).sql.gz; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment