Skip to content

Instantly share code, notes, and snippets.

@wlasser
Forked from gagarine/mysql_multiple_import.bash
Created January 21, 2013 21:47
Show Gist options
  • Save wlasser/4589781 to your computer and use it in GitHub Desktop.
Save wlasser/4589781 to your computer and use it in GitHub Desktop.
#!/bin/bash
db=$1
user=$2
passwd=$3
if [ "$db" = "" ]; then
echo "Usage: $0 db_name user password"
exit 1
fi
clear
for sql_file in *.sql; do
echo "Importing $sql_file";
mysql5 --user=$user --password=$passwd $db< $sql_file;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment