Impact of Column Differences on MySQL RBR Master‑Slave Replication
This article explains why, in MySQL row‑based replication, a master table having an extra column does not disrupt replication to a slave table lacking that column, provided column order, placement, and default values meet specific conditions, and demonstrates the behavior with a MySQL 5.7.25 test.
Row‑Based Replication (RBR) is widely used in MySQL master‑slave setups, and a common question is whether differences in column definitions between the master and the slave affect replication.
Problem
The master table A has two columns (c1 int, c2 int) while the slave table A only has one column (c1 int). If the master performs INSERT or UPDATE on column c2, will replication be impacted?
Conclusion
The replication is not affected.
Verification (MySQL 5.7.25)
Structure and data of the master table t1:
Structure and data of the slave table t1:
Slave replication status:
Master executes an INSERT operation:
Slave shows replication status and synchronized result:
Master executes an UPDATE operation:
Slave shows replication status and t1 data:
Reason
In MySQL replication the table structures on master and slave can differ; the master may have more or fewer columns than the slave, and this does not affect replication provided certain conditions are met.
Conditions
1. The definitions of columns that exist on both sides must appear in the same order.
2. The definitions of common columns must be placed before any differing columns.
3. Any differing columns must have a default value.
Reference: MySQL Documentation on Replication with Differing Tables
Aikesheng Open Source Community
The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.