extracting single database from a [large] mysqldump

extracting the whole database:

sed -n '/^-- Current Database: `databaseName`/,/^-- Current Database: `/p' /path/to/the/fill/dump.sql  > output.sql

single table:

sed -n '/^CREATE TABLE `tableName`/,/^\-\- Table structure for table /p' /path/to/the/fill/dump.sql  > output.sql

[via this blog]

Leave a Reply

Your email address will not be published. Required fields are marked *

(Spamcheck Enabled)