Recovery based on all libraries
Mysqlbinlog mysql-bin.000020 > All.sql #备份所有库
Recovery based on the specified library
mysqlbinlog-d wsyht mysql-bin.000020 > Wsyht.sql #备份wsyht库的备份语句,-D intercepts the binlog of the specified library
mysql-uroot-pwsyht123 < Wsyht.sql
Incremental recovery based on location points
Specify starting and ending positions
Mysqlbinlog mysql-bin.000020--start-position=510--stop-position-r pos.sql #-r equivalent redirect, intercept by location
Mysqlbinlog mysql-bin.000020--start-datetime= ' 2015-12-04 17:15:12 '--stop-datetime= ' 2015-12-04 17:18:12 '-R time.sql #按照时间截取
Turn on the Binlog feature
[[email protected] ~]# grep log-bin/etc/my.cnf
Log-bin=mysql-bin
Mysqlbinlog logs are used to record MySQL internal additions and deletions, and other updates to the MySQL database.
Hope to communicate with the technology can contact me by the following ways
My OPS group 517751492
My QQ1934844044.
This article is from the "Wsyht blog" blog, make sure to keep this source http://wsyht2015.blog.51cto.com/9014030/1719703
Mysqlbinlog command to use, Binlog log backup to restore