CertGrid CertGrid
Hands-on Lab·MySQL

MySQL Replica Seeding

A replica has to start from a known point, not an empty database. The dump carries a GTID_PURGED line that tells the replica what it already has - and getting that line to apply is the step everyone gets wrong.

Replication Guide 27 of 45 Advanced

--source-data=2 writes the coordinates as a comment. In MySQL 8.4 RESET BINARY LOGS AND GTIDS replaced the older RESET MASTER.

The dump is pulled from db-a01 across the network by db-b01, which avoids copying a file between hosts.
Server NameIP AddressOSRolesCPURAMHDD
db-a01192.168.0.81Ubuntu 26.04 LTSPrimary / Source / Replica Set Member 12 Core4 GB50 GB
db-b01192.168.0.82Ubuntu 26.04 LTSStandby / Replica / Replica Set Member 22 Core4 GB50 GB

This guide includes

Use this when a replica has to start from a known point rather than an empty database. This matters because clearing the replica's own history before loading is easy to skip and impossible to fix afterwards.

Before you start

  1. Create a temporary account that can read everything

  2. Pull the dump across the network

  3. Clear the replica's own history before loading

  4. Confirm the handover landed

Official sources