A little note

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.