Reputation: 25
I have dir with a lot of .sql
files. I want to import them all at once when creating the database. Is it possible without doing it one-by-one?
I already tried
mysql -u user -p Database < *.sql
but no luck.
Upvotes: 1
Views: 41
Reputation: 15057
You can do it so:
cat *.sql | mysql -u user -p Database
OR
cat *.sql >/tmp/all.sql
mysql -u user -p Database < /tmp/all.sql
rm /tmp/all.sql
Upvotes: 1