Skip to content

Instantly share code, notes, and snippets.

@dmitriynet
Created February 10, 2016 12:20
Show Gist options
  • Save dmitriynet/f5263ced0b8ebccc694e to your computer and use it in GitHub Desktop.
Save dmitriynet/f5263ced0b8ebccc694e to your computer and use it in GitHub Desktop.
Dump per tables SH
username=$1
password=$2
dbname=$3
for file in *.sql; do
echo "${file%.sql}.sql started\n";
mysql -u $username -p$password --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