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
精彩评论