Master-Slave synchronization principle:
Execution of any SQL statement on the primary server will write the statement to the Mysqlbinlog binary log, from the server will always synchronize to update the binary log file to the local, and then the log file in the SQL statement to re-execute again, note that not all the statements in the file are executed again, Instead, there is a POS signal point that executes all the SQL statements after the last point that the POS signal was executed. So the primary server is going to open the binary log file.
Points:
① the data on the master-slave server is consistent
② Primary server to open mysqlbinlog binary log file (master-slave data synchronization is through this log file)
③ from the server to be able to connect to the primary server, so to authorize from the server on the primary server
This article is from the "See" blog, please be sure to keep this source http://732233048.blog.51cto.com/9323668/1616386
MySQL master-Slave synchronization principle and key points