开发者

Mysql Windows "mysqldump -t" restore

Yes it's Windows sorry.

I'm using mysqldump with the option -T which creates a sql an开发者_开发问答d 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.


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.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜