Created
May 28, 2014 14:59
-
-
Save mshmsh5000/17b1deab05bcfaafc4ad to your computer and use it in GitHub Desktop.
Import SQL from nightly dump
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
#!/usr/bin/env bash | |
# Create the MySQL tables | |
for file in *.sql | |
do | |
echo $file | |
cat $file | mysql -u USER -pPASS DBNAME | |
cat $file | mysql -u USER -pPASS DBNAME | |
done | |
# Import the data | |
for data in *.txt | |
do | |
mysqlimport -u USER -pPASS --local DBNAME $data | |
mysqlimport -u USER -pPASS --local DBNAME $data | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment