Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dump to database
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