Documentation Home
MySQL Backup and Recovery
Related Documentation Download this Excerpt
PDF (US Ltr) - 209.7Kb
PDF (A4) - 207.8Kb


MySQL Backup and Recovery  / ...  / Backup and Recovery  / Using mysqldump for Backups  / mysqldump Tips  /  Dumping Table Definitions and Content Separately

1.4.5.4 Dumping Table Definitions and Content Separately

The--no-data option tellsmysqldump not to dump table data, resulting in the dump file containing only statements to create the tables. Conversely, the--no-create-info option tellsmysqldump to suppressCREATE statements from the output, so that the dump file contains only table data.

For example, to dump table definitions and data separately for thetest database, use these commands:

$> mysqldump --no-data test > dump-defs.sql$> mysqldump --no-create-info test > dump-data.sql

For a definition-only dump, add the--routines and--events options to also include stored routine and event definitions:

$> mysqldump --no-data --routines --events test > dump-defs.sql