In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Introduction:
mysqlbinlog_back.py is a tool that reads the binlog of mysqld in row format online and generates sql statements in reverse.
Generally used for data recovery purposes. The so-called reverse sql statement is that if it is insert, then the reverse sql is delete.
If delete, reverse sql is insert, if update, reverse sql is update, but update is the original value.
This project needs to install dependencies
yum install python-pippip install pymysql
Official address: github.com/58daojia-dba/mysqlbinlog_flashback
Use restrictions:
1. mysql binlog must be in row format. 2. Reverse generated tables must have a primary key. 3. Log must be in master inventory at 4. Reverse generated mysql data types are listed below. Types not listed have not been rigorously tested and may have problems 5. Supported types
Field types allowed to be parsed. Error will be reported if they are not inside.
ALLOW_TYPE={ "varchar":True, "char":True, "datetime":True, "date":True, "time":True, "timestamp":True, "bigint":True, "mediumint":True, "smallint":True, "tinyint":True, "int":True, "smallint":True, "decimal":True, "float":True, "double":True, "longtext":True, "tinytext":True, "text":True, "mediumtext":True }
Tool installation:
Installation packages can be downloaded on GitHub
Direct decompression can be decompressed into the directory as follows:
Tool usage:
#View the parameter usage instructions python mysqlbinlog_back.py --help #Roll back a table python mysqlbinlog_back.py --host="192.168.1.60" --port=3306 --username="root" --password="yourpassword" --schema=test --tables="test_tb" -S "mysql-bin. 00009"
Rollback statements are generated in the mysqlbinlog_flashback-master/log directory after the rollback is complete
Then execute the following statement to roll back in the database
mysql -uroot -pyourpassword --default-character-set=utf8mb4 test < flashback_test_20170912_170610.sql
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.