Mysql uses the row format binlog to undo the operation

Source: Internet
Author: User

When MySQL uses the row format and the default binlog_row_image = full, the binlog records the complete data image before and after the update. Therefore, it is feasible to perform the undo operation based on the binlog in the row format. I tried this tool.

[GitHub Page] [linux binary file]

For example

./Binlog_undo-f/data/mysql/log-bin.000004-p 3958-o binlog. out
Scans all transactions from position 3958 to the end of/data/mysql/log-bin.000004, reverses all the transaction order and the statement order in each transaction, and reverse all the operations, reverses WRITE and DELETE, swaps the pre-and post-UPDATE images, and then writes the generated binlog file to binlog. out. Then you can use the mysqlbinlog tool to play back the binlog to cancel the operation.

This tool can be used to cancel the operations that are not synchronized to the slave after the master-slave switchover to avoid full reconstruction. It can also be used as a regret for misoperations.

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.