Replication

suggest change

Remarks

Replication copies data from one MySQL server to one or more others. It is not a backup by itself: a bad statement is copied too.

Master – The MySQL database server, which is serving data to be copied

Slave – The MySQL database server, copies data which is served by Master

With MySQL, replication is asynchronous by default. This means slaves do not need to be connected permanently to receive updates from the master. For example, if your slave is switched OFF or not connected with master and you are switching slave ON or connect with Master at a later time, then it will automatically synchronize with the Master.

Depending on the configuration, you can replicate all databases, selected databases, or even selected tables within a database.

Replication Formats

There are two core types of replication formats

Statement-based replication (SBR) replicates whole SQL statements. The source writes the statements to the binary log, and the replica executes those statements.

Row Based Replication (RBR) – which replicates only the changed rows. In this, the master writes events to the binary log that indicate how individual table rows are changed. Replication of the master to the slave works by copying the events representing the changes to the table rows to the slave.

A third setting, binlog_format=MIXED, uses statement logging or row logging for each change, whichever is safer.

Statement-based format was the default in MySQL versions older than 5.7.7. In MySQL 5.7.7 and later, row-based format is the default.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents