CertGrid CertGrid
Hands-on Lab·MySQL

MySQL Logical Backups with mysqldump

A dump is a text file of SQL statements that rebuilds the database. --single-transaction is the flag that makes it consistent without locking anyone out, and it is the one most people leave off.

Backup and Restore Guide 21 of 45 Beginner

--single-transaction gives a consistent snapshot for InnoDB tables only. A schema mixing InnoDB and MyISAM cannot be dumped consistently without locking.

Every command on this page ran on db-a01.
Server NameIP AddressOSRolesCPURAMHDD
db-a01192.168.0.81Ubuntu 26.04 LTSPrimary / Source / Replica Set Member 12 Core4 GB50 GB

This guide includes

Use this when you need a backup you can actually read. This matters because a dump is plain SQL that rebuilds the database - and a backup nobody has looked inside is a hypothesis rather than a backup.

Before you start

  1. Take the dump

  2. Look at what a dump actually is

  3. Confirm it contains both structure and data

Official sources