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?
MySQL – How to Import Only Schema from Full Dump
MySQLmysqldump
Related Question
- Mysql – How to dump only the data for all tables using thesqldump
- MySQL – Dump with View Dependent on User
- MySQL – Easy Way to Select One DB Dump from Multiple DB Dumps
- MySQL Performance – Settings to Speed Up a Mysqldump Import
- Mysql – Is “–one-database” safe to use for importing from a dump
- MariaDB/MySQL – How to Import from Dump File Remotely via Network
Best Answer
A mysqldump is only inserts, not updates. So
grep -v "^INSERT" dump.sql
should be sufficient. Take a look before using