1. Slave cannot execute any SQL, including Super user
2, Read_only=on, this must be opened to avoid business execution SQL
3. Ensure that the transaction ID of the current slave is 1
When a problem occurs in the slave sync, manually skip the issue that needs to be considered
The SQL that executes does not record the transaction ID, otherwise slave switches to master, which causes the synchronization to fail because Binglog has already been removed.
SET @MYSQLDUMP_TEMP_LOG_BIN = @ @SESSION. Sql_log_bin;
SET @ @SESSION. sql_log_bin= 0;
This step executes the specific SQL
Dml\ddl
SET @ @SESSION. Sql_log_bin = @MYSQLDUMP_TEMP_LOG_BIN;
To view the UUID of the current data
Show GLOBAL VARIABLES like ' server_uuid ';
View the executed transactions for the current database
Show master status;
Set Transaction ID manually
SET @MYSQLDUMP_TEMP_LOG_BIN = @ @SESSION. Sql_log_bin;
SET @ @SESSION. sql_log_bin= 0;
SET @ @GLOBAL. Gtid_purged= ' 132028ab-abc5-11e6-b2f0-000c29a60c3d:1-45679 ';
SET @ @SESSION. Sql_log_bin = @MYSQLDUMP_TEMP_LOG_BIN;
Issues to be aware of when opening Gtid database