Mysql logbin Data Log Recovery database, mysqllogbin
========================================================== ====================
BINLOG export SQL File
========================================================== ====================
C: \ Program Files \ MySQL Server 5.7 \ bin> mysqlbinlog binlogpath> sqlfilepath-d dbname-f -- stop-datetime stopdatetime -- start-datetime startdatetime
------------- Parameter description ----------------
Binlogpath BINLOG full path (D: \ data_backup \ mysql_binlog \ bin-log.000013)
Full path to the SQL file exported from sqlfilepath: (d: \ a.13.11. SQL)
Stopdatetime BINLOG: (T13: 33: 26)
Startdatetime BINLOG export Start Time: (T09: 43: 02)
Dbname BINLOG export filtered data name
========================================================== ====================
Execute an SQL file using the command line
========================================================== ====================
Mysql-f-uroot-ppwd-Ddbname <file
---------- Parameter description -------------
-F ignore error and continue execution
-U database username
-P Data pwd special character Escape Character ^
-D: target database of the execution File
Full path of the SQL file executed by file
========================================================== ====================
Another new BINLOG file mysql command is run.
========================================================== ====================
Flush logs;
========================================================== ====================
BAT executes multiple files for mysql and records the completion time log, which needs to be optimized to
========================================================== ====================
@ Echo off
Mysql-uroot-ppwd-Ddbname <D: \ cc \ bin-log.000010. SQL
Set d = % date :~ 0, 10%
Set t = % time :~ 0, 8%
Echo % d % t % bin-log.000010. SQL execed> d: \ cc \ result.txt
Mysql-uroot-p1q2w3e4r5t ^ Y ^ & U * I (O) P-Dleizuwenhuadb <D: \ cc \ bin-log.000011. SQL
Set d1 = % date :~ 0, 10%
Set t1 = % time :~ 0, 8%
Echo % d1 % t1 % bin-log.000011. SQL execed> d: \ cc \ result.txt
Mysql-uroot-p1q2w3e4r5t ^ Y ^ & U * I (O) P-Dleizuwenhuadb <D: \ cc \ bin-log.000012. SQL
Set d2 = % date :~ 0, 10%
Set t2 = % time :~ 0, 8%
Echo % d2 % t2 % bin-log.000012. SQL execed> d: \ cc \ result.txt
Mysql-uroot-p1q2w3e4r5t ^ Y ^ & U * I (O) P-Dleizuwenhuadb <D: \ cc \ bin-log.000013. SQL
Set d3 = % date :~ 0, 10%
Set t3 = % time :~ 0, 8%
Echo % d3 % t3 % bin-log.000013. SQL execed> d: \ cc \ result.txt
Echo % d3 % t3 % all exec complate> d: \ cc \ result.txt
Pause