开发者

Mysql Windows "mysqldump -t" restore

开发者 https://www.devze.com 2022-12-31 08:04 出处:网络
Yes it\'s Windows sorry. I\'m using mysqldump with the option -T which creates a sql an开发者_开发问答d a txt file per table.

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

精彩评论

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