Last active
January 20, 2016 13:37
-
-
Save dmitriynet/90dd19fde0125d847366 to your computer and use it in GitHub Desktop.
Dump to database
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
username=$1 | |
password=$2 | |
dbname=$3 | |
for file in *.sql; do | |
echo "${file%.sql}.sql started\n"; | |
mysql -u $username -p$username --default-character-set=utf8 $dbname < "${file%.sql}.sql"; | |
echo "${file%.sql}.sql done\n"; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment