mysqldump --no-data mydb > schema.sql

Category: Databases & SQL

mysqldump --no-data mydb > schema.sql

Back up only table structures

Writes DDL without any rows — handy for migrations or standing up an empty copy of the schema. The flip side is --no-create-info, which dumps data only. Related: SHOW CREATE TABLE.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.