Replication works because events written to the binary log are read from the master and then processed on the slave. The events are recorded in different formats according the event being recorded. The different formats are as follows:
Replication capabilities in MySQL originally were based on propagation of SQL statements from master to slave. This is called statement-based replication (SBR).
In row-based replication (RBR), the master writes events to the binary log that indicate how individual table rows are affected. Support for RBR was added in MySQL 5.1.5.
As of MySQL 5.1.8, a third option is available: mixed-based replication (MBR). With MBR, statement-based replication is used by default, but automatically switches to row-based replication in particular cases as described below. See Section 6.1.2.2, “Mixed Replication Format”.
Starting with MySQL 5.1.12, mixed-based replication (MBR) is the default format for all replication environment unless you specify otherwise.
For a comparison that shows the advantages and disadvantages of statement-based and row-based replication, see Section 6.1.2.3, “Comparison of Statement-Based Versus Row-Based Replication”.
MySQL Cluster Replication also makes use of row-based replication. For more information, see Section 15.10, “MySQL Cluster Replication”.
With MySQL's classic statement-based replication, there may be issues with replicating stored routines or triggers. You can avoid these issues by using MySQL's row-based replication instead. For a detailed list of issues, see Section 18.4, “Binary Logging of Stored Routines and Triggers”.
If you build MySQL from source, row-based replication is available
by default unless you invoke configure with the
--without-row-based-replication option.

User Comments
Add your own comment.