Package: Link: Https://pan.baidu.com/s/15dDeGufVWOgVrfATGWBzaA Password: gnz8
DBA or developer, sometimes mistakenly delete or mistakenly update the data, if it is an online environmentwill beThe impact is large,ityou need to be able to roll back quickly; andMySQL Flash back (flashback) utilizes Binlogcan beto roll back directly,and canFast RecoveryData (MySQLFlash back now only supportsDML statement to flash back).
Use Binlog required conditions for Flash back:
ysql parameter setting:
Log_bin = /Catalogue/ Mysql-bin.log (Open)
Binlog_format = row
binlog_row_image = full ( default is Full )
Working principle is mainlyforDelete operation, remove the delete message from Binlog, and generate the Insert ROLLBACK statement.forinsert operation, rollback of SQL is delete. forupdate operation, rollback SQL should swap the set and where values.
Installation:
Environment ready to install various dependent toolkit lists
Change Python to python3.6 version (Python version upgrade reference blog: 78218277)
Python-pip,
Pymysql,
Python-mysql-replication,
Wheel Argparse
1. Binlog2sql Download
Https://github.com/danfengcao/binlog2sql
2. Binlog2sql Dependent Package Installation
(1) PyMySQL-0.8.0 installation
https://pypi.python.org/pypi/PyMySQL/
[email protected] binlogsql]# TAR-XZVF pymysql-0.8.0.tar.gz
[Email protected] binlogsql]# CD PyMySQL-0.8.0
[[email protected] pymysql-0.8.0]# python setup.py install
(2) wheel-0.31.0 installation
https://pypi.python.org/pypi/wheel/
[email protected] binlogsql]# TAR-XZVF wheel-0.31.0.tar.gz
[Email protected] binlogsql]# CD wheel-0.31.0
[[email protected] wheel-0.31.0]# python setup.py install
(3) Python-mysql-replication installation
Https://github.com/noplay/python-mysql-replication
[email protected] binlogsql]# Unzip Python-mysql-replication-master.zip
[Email protected] binlogsql]# CD Python-mysql-replication-master
[[email protected] python-mysql-replication-master]# python setup.py install
(4) The corresponding dependency package can be installed via PIP
Https://pypi.python.org/pypi/pip
[email protected] tools]# TAR-XZVF pip-10.0.1.tar.gz
[Email protected] tools]# CD pip-10.0.1
[[email protected] pip-10.0.1]# python setup.py install
[email protected] binlog2sql-master]# pip Install-r requirements.txt
There may be an error.
Filenotfounderror: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/mysql_ Replication-0.18-py3.6.egg '
Dependency on package version issues.
Perform.. Pip Install Mysql-replication
Then execute PIP install-r requirements.txt
The display has been installed to complete.
MySQL Flash back tool binlog2sql installation use