从多个SQL文件还原SQL [英] Restoring SQL from multiple SQL files

查看:144
本文介绍了从多个SQL文件还原SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含400多个sql文件的数据库备份. foreach表有一个单独的sql文件.是否可以将所有这些文件一起导入数据库?如果可以的话,您能告诉我该怎么做吗?

I have a database backup with 400+ sql files. foreach table there is a separate sql file. Is it possible to import all this files together to a database? If so could you tell me how to do this?

此外,备份也是压缩的tar文件.有没有一种方法可以从压缩文件中还原?

Also the backup is a gzipped tar file. Is there a way to restore from a compressed file.?

推荐答案

我在这里找到了我的问题的答案. 从shell导入多个.sql转储文件到mysql数据库中

I have found the answer for my question here. Import Multiple .sql dump files into mysql database from shell

find . -name '*.sql' | awk '{ print "source",$0 }' | mysql --batch完美运行.感谢@Haim指出正确的帖子.

find . -name '*.sql' | awk '{ print "source",$0 }' | mysql --batch works perfectly. Thanks for @Haim to pointing out the correct post.

这篇关于从多个SQL文件还原SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆