Section: mysqldump and restore

Dump schema only

bash
bash
mysqldump -u root -p --no-data app_db > app_db-schema.sql
Explanation

Common when you want table definitions for code review or environment bootstrapping.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing mysqldump and restore
Dump one database
Export schema and data from one database.
OpenIn sheetbashsame section
Dump one table
Export a single table only.
OpenIn sheetbashsame section
Dump data only
Export rows without CREATE statements.
OpenIn sheetbashsame section
Restore from a SQL dump
Load a dump file into MySQL.
OpenIn sheetbashsame section
Export query results to CSV-like output
Write rows to a server-side file.
Load CSV data into a table
Import delimited files efficiently.