Reputation: 763
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 need 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.
Upvotes: 0
Views: 3472
Reputation: 10371
@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
Upvotes: 1