1. In manually enabling start transaction, the first SQL statement is DML and the second SQL statement is DDL. When you manually execute rollback, it is found that rollback is invalid. Cause: after the second DDL statement is executed, commit is implicitly executed. Therefore, the first SQL statement has been committed at this time. The final execution of rollbakc is naturally invalid.
2. How to Avoid synchronization of Master/Slave Data: 1. Use SQL _slave_skip_counter to run the SQL thread. Naturally, some table data is not synchronized. 2. Run Pt-table-checksum to check which tables are not synchronized. 3. Run Pt-table-Sync and specify -- replicate to synchronize data.
3. New BINLOG method: Show BINLOG in 'mysql-bin. xxxxx' from position;
Mysql> show BINLOG events in 'mysql-bin.000032' from 4577235 limit 5;
+ ------------------ + --------- + ------------ + ----------- + ------------- + ---------------------------------------------------------------- +
| Log_name | POS | event_type | server_id | end_log_pos | info |
+ ------------------ + --------- + ------------ + ----------- + ------------- + ---------------------------------------------------------------- +
| Mysql-bin.000032 | 4577235 | query | 1 | 4577309 | begin |
| Mysql-bin.000032 | 4577309 | query | 1 | 4577428 | use 'pango _ test'; insert into Test2 values (11, 'admin10', 1234, 'abce ') |
| Mysql-bin.000032 | 4577428 | query | 1 | 4577547 | use 'pango _ test'; insert into Test2 values (12, 'admin10', 1234, 'abce ') |
| Mysql-bin.000032 | 4577547 | Xid | 1 | 4577574 | commit/* Xid = 8749775 */|
4. SQL _slave_skip_counter = N, which refers to N transactions. For example, if the position is 4577235 and SQL _slave_skip_counter = 1 is executed, the position becomes 4577547.