Created
March 22, 2021 14:27
-
-
Save woffleloffle/633f11373067f17e3cd2d2613e0f195b to your computer and use it in GitHub Desktop.
Dump every database on a MySQL server
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
#/bin/sh | |
mysql -u root -pPASSWORD -e 'show databases' | tail -n +2 | while read DB | |
do | |
mysqldump -u root -pPASSWORD "$DB" > "/path/to/your/backup/$DB.sql" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment