Hands-on Lab·MySQL
MySQL Partial and Schema-Only Dumps
Dump one table, or the structure with no rows at all. --no-data produces a file with zero INSERT statements - useful for a schema diff, and catastrophic if you thought it was your backup.
Backup and Restore Guide 23 of 45 Intermediate
- OSUbuntu 26.04 LTS
- MySQL8.4.10-0ubuntu0.26.04.1
- BinlogROW format, enabled by default
- TimeAbout 11 min
Table selection syntax is positional - database first, then tables. It reads oddly and is a common source of dumping the wrong thing.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| db-a01 | 192.168.0.81 | Ubuntu 26.04 LTS | Primary / Source / Replica Set Member 1 | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a full dump is the wrong tool. This matters because one table, or the structure with no rows at all, is a small change to the same command rather than a different one.
- dumping a single table, where its name follows the database name with no flag
- using
--no-datato write every CREATE TABLE and not a single row - seeing that both are the same command with one small change
Before you start
- The restored
appdbfrom the previous guide.
-
Dump a single table
-
Dump the structure with no data at all