Get the App
SLTechnology News&Howtos  ›  Database  › 

How to undo an operation when mysql uses row format binlog

Shulou Source: shulou.com Published: 2022-06-01 20:48:34 10月03日 Update

This article mainly introduces mysql how to undo the operation when using row format binlog, what it involves, from theoretical knowledge to learn, there are many books, literature for everyone to refer to, from a practical point of view, accumulated years of practical experience can be shared with you.

MySQL uses row format and uses the default binlog_row_image=full, binlog records the complete pre-and post-update data image. Therefore, undo operations based on row format binlog are feasible. This article mainly introduces mysql use row format binlog undo operation example, hope to help you can help to everyone.

[GitHub page] [linux binaries]

for example

./ binlog_undo -f /data/mysql/log-bin.000004 -p 3958 -o binlog.out

It scans all transactions in/data/mysql/log-bin.000004 from position 3958 to the end, reverses the order of all transactions and statements in each transaction, reverses all operations, inverts WRITE and Delete, swaps the front and back mirrors of UPDATE, and then writes the generated binlog file to binlog.out. Then you can undo the operation by playing back the binlog with the mysqlbinlog tool.

This tool can be used to cancel the operation that is not synchronized to the backup on the original after the active and standby switch, to avoid complete reconstruction; it can also be used as a regret medicine for misoperation.

Related recommendations:

MySQL Creating Users and Authorizing and Revoking User Rights

mysql5.7 create user authorization delete user revocation authorization sample code

Oracle PL/SQL object permissions and system permissions revocation differences

The above is a detailed explanation of mysql using row format binlog undo operation details, more please pay attention to other related articles!

Tags: Format user transaction permission tool file image order help feasible thing book binary code location example content original owner regret medicine for many years Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Tech Info MySQL Microsoft vpn