MySQL-Backup & Restore
Point-in-Time (Incremental) Recovery
Point-in-Time Recovery Using Binary Log -->Point-in-time recovery is the set of binary log files generated subsequent to the full backup
operation. Therefore, to allow a server to be restored to a point-in-time, binary logging must be enabled on it,
mysql> SHOW BINARY LOGS; --->To see a listing of all binary log files, use this statement:
mysql> SHOW MASTER STATUS; ---> Determine the name of the current binary log file
Point-in-Time Recovery Using Event Positions --> mysqlbinlog utility converts the events in the binary log files from binary format to text
so that they can be viewed or applied. mysqlbinlog has options for selecting sections of the binary log based on event times or position of
events.
shell> mysqlbinlog binlog_files | mysql -u root -p
Let’s run the command which will convert binary logs into SQL format starting from the position we found in the backup log:
1
root@vagrant:~# mysqlbinlog --start-position='16184120' --verbose /var/lib/mysql/binlog.000008 /var/lib/mysql/binlog.000009 > binlog.out
Please node ‘--verbose’ is required to decode row-based events. This is not necessarily required for the DROP TABLE we are looking for, but for other type of events it may be needed