Skip to content

Instantly share code, notes, and snippets.

@dmitriynet
Last active January 20, 2016 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitriynet/90dd19fde0125d847366 to your computer and use it in GitHub Desktop.
Save dmitriynet/90dd19fde0125d847366 to your computer and use it in GitHub Desktop.
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