6 MySQL Synchronization
The synchronization function was introduced in MySQL
3.23.15. It can copy data on a MySQL server to Another server goes up. This chapter describes the various replication features of MySQL. Introduces the concept of synchronization, how to set up a synchronization server, and a reference to available servers. It also provides a series of frequently asked questions and their answers, as well as troubleshooting.
"14.6 Replication Statements" introduces synchronization-related SQL statement syntax.
We recommend visiting "http://www.mysql.com" frequently to read the latest content of this chapter. The synchronization feature is constantly being improved, and we frequently update this part of the manual with the latest content.
6.1 Introduction to synchronization
MySQL
3.23 Versions .15 and above support one-way synchronization. One server serves as the master (master server), and one or more servers serve as slaves (slave servers). The master server writes the updated content to the binary log (binary
log or binlog), and maintains an index file to record the log cycle. Updates in these logs are sent to the slave server. After a slave connects to the master, it notifies the master of the log location of the last successful incremental update. The slave will find all update operations starting from that moment, then block and wait for the master to send new update operations.
If you want to create a synchronous server chain, the slave can also serve as the master.
Note that after synchronization is enabled, all update operations to be synchronized must be performed on the master. Otherwise, care must be taken not to cause conflicts between user updates on the master and updates on the slave.
The benefits of one-way synchronization are robustness, high speed, and easy system management:
With the master/slave mechanism, it is more robust . When a problem occurs on the master, the slave can be switched as a backup.