Binary log format

Binary logs can be written in three formats:

  1. STATEMENT: Actual SQL statements are logged.
  2. ROW: Changes made to each row are logged. For example, an update statement updates 10 rows, the updated information of all 10 rows is written to the log. Whereas in statement-based replication, only the update statement is written. The default format is ROW.
  3. MIXED: MySQL switches from STATEMENT to ROW as and when needed. 

There are statements that can cause different results when executed on different servers. For example, the output of the UUID() function differs from server to server. Those statements are called non-deterministic and are unsafe for statement-based replication. In those situations, a MySQL server switches to row-based ...

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.