1, in MySQL's My.ini file
2 Create a Binlog folder under my D drive
3 Restart MySQL service can see my d drive under the binlog below to generate the following files
4, create the T_one1 table in the default test database
CREATE TABLE T_one1 (ID
www.baohuayule.cn
varchar (ten), name varchar (2));
4.1 Insert a few data, and then can see wxzlog.000001 This file modification date changes, this file is our database to add and delete change records, do not record the query, we can use MySQL
Bring your own mysqlbinlog to view
4.2 T_one1 This watch, and then we take steps to restore it.
5 Switch to cmd in the bin directory where you installed MySQL as
6, for viewing Mysqlbinlog d:www.wanmeiyuele.cn \binlog\wxzlog.www.leyouzaixan.cn 000001, you can see as part of my interception
1, it's time.
2, is the location
We can use both time and location to recover
The command is as follows:
Use location recovery
Mysqlbinlog--stop-position= "2137" d:www.baohuayule.com \binlog\wxzlog.000001 | Mysql-uroot-p
Use time recovery
Mysqlbinlog--stop-datetime= "2018-04-20 13:39:11" D www.huayu1178.cn: \binlog\wxzlog.000001 | Mysql-uroot-p
Recover data for a time period
Mysqlbinlog--start-datetime= "2018-04-20 13:32:13" www.yszx11.cn/--stop-datetime= "2018-04-20 www.006665.cn 13:39:11 "d:\binlog\wxzlog.000001 |
Incremental backup of MySQL