I have a full database export (single file, schama + data), but I would like to import only the database schema. Is there any magic option or trick to achieve this? I'm NOT able to perform a "mysql_dump --no-data" at the original database at this moment. Is removing all inserts and updates manual (awk/grep/vim) from the dump file the only option?
2 Answers
A mysqldump is only inserts, not updates. So grep -v "^INSERT" dump.sql
should be sufficient. Take a look before using
-
I was expecing a magic option for mysql import, but finaly, I have filtered out the inserts. Even if the dump file was 2+GB, it went quite well.– psadApr 16, 2019 at 13:08