Created
July 25, 2011 18:24
-
-
Save edfuh/1104785 to your computer and use it in GitHub Desktop.
saving this here because I always lose it
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
#!/bin/sh | |
echo "MySQL User:"; | |
read MYSQLUSER; | |
echo "MySQL Pass:"; | |
read MYSQLPASS; | |
for I in $(mysql -h localhost -u $MYSQLUSER --password=$MYSQLPASS -e 'show databases' -s --skip-column-names); | |
do mysqldump -u $MYSQLUSER -h localhost --password=$MYSQLPASS $I | gzip > "$I.sql.gz"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment