Pierre de LESPINAY
Pierre de LESPINAY

Reputation: 46178

Mysql Windows "mysqldump -t" restore

Yes it's Windows sorry.

I'm using mysqldump with the option -T which creates a sql and a txt file per table.

mysqldump -u user -ppass db -T path

I use that option to be able to restore easily one table.

Now I'd like to restore all the tables.

mysql -u user -ppass db < path/*.sql

Obvously doesn't work

Also, I don't know where do my funcs/procs go.

Upvotes: 2

Views: 652

Answers (1)

ewall
ewall

Reputation: 28110

You could use a FOR loop with the file wildcard (*.sql) to process each one, like this:

FOR /R %F in (*.sql) DO (
  mysql -u user -ppass database %F
)

(Note that if you're running this from a batch file, the variable should be shown as %%F instead of just %F.)

Upvotes: 3

Related Questions