Skip to content

Instantly share code, notes, and snippets.

@alfrekjv
Created April 24, 2012 17:08
Show Gist options
  • Save alfrekjv/2481566 to your computer and use it in GitHub Desktop.
Save alfrekjv/2481566 to your computer and use it in GitHub Desktop.
Import many .sql files into mysql
#!/bin/bash
FILES=/home/alfrek/databases/*.sql
for f in $FILES
do
echo "Importing $f ..."
# take action on each file. $f store current file name
mysql -u root -p < $f
echo "Finished importing $f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment