CertGrid CertGrid
Troubleshooting·MySQL

MySQL Replica Write Protection

A fresh replica is not read-only. A write to it succeeds, diverges the data and plants a transaction the source has never heard of - and super_read_only is the one-line prevention.

Replication Guide 29 of 45 Intermediate

read_only alone does not stop users with the SUPER privilege - which includes root, and therefore most people connecting to fix something. super_read_only is the one that means it.

The 2 hosts these commands ran on: db-a01, db-b01.
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 immediately after a replica starts working. This matters because a fresh replica accepts writes - and one local write puts a transaction into its GTID history that the source has never seen.

Before you start

  1. Discover that the replica accepts writes

  2. See what that write did to the GTID history

  3. Close the door

  4. Confirm replication still works through it

Official sources