开发者

Extract data dumps from .sql file

I've got an .sql file, it's an database backup from four years ago. This .sql file is filled with table creations but also data dumps. Because I actually don't n开发者_JAVA技巧eed and want the data I'm looking for an way to extract all the data dumps from the .sql file. So that I'm only restoring the tables architecture.

I think the .sql file was generated by cPanel backup service.

Is there some automated way of doing this? I can't do it by hand because the .sql file has an enormous amount of lines.


@Boyd: Import the dump file locally using

mysqldump -d -h localhost -u root -p thedatabase > dumpfile.sql

Then export just the structure using

mysqldump -u username -p --no-data thedatabase > newdumpfile.sql
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜