I am having a mysqldump file which contains schema as well as data dump.
I need to import only database schema from my sqldump. I tried with following command:
mysql -uUSER -pPASSWORD < filename.sql
but of no help. it imports both schema as well as data.
How can I do it?
IMHO, the easiest solution is to just open the dump in a regular text editor and copy the
CREATE TABLE ...statements into another file. I would not even care about doing anything else.If that’s not an option for whatever the reason, you can simply create a new dump and this time separate structure and data in two files.
If that’s not an option either, you can load the dump into a local MySQL server create the new dump from there, or use a GUI tool like HeidiSQL to transfer the structure right into the destination server.