MySQL Internals Manual  /  The Binary Log  /  Row-Based Binary Logging

20.10 Row-Based Binary Logging

Originally, the binary log was written using statement-based logging. Row-based logging was added in MySQL 5.1.5.

  • Statement-based logging: Events contain SQL statements that produce data changes (inserts, updates, deletes)

  • Row-based logging: Events describe changes to individual rows

Several event types are used specific to row-based logging:





It's common to refer to "row-based logging" (RBL) as "row-based replication" (RBR), but RBR is in fact a misnomer. Logging in this format can be done independent of whether the log is used for replication. That is, replication need not figure into the use of the binary log at all. Similar remarks apply to the terms "statement-based logging" (SBL) versus "statement-based replication" (SBR). Unfortunately, by now the RBR/SBR terminology is probably too well entrenched for there to be much hope of a return to the proper RBL/SBL terms, so I must content myself with including this nomenclatural screed here. :-)