Binary Logging

All transactions within MySQL are recorded in the binary logs automatically. Incremental changes are normally made using the binary logs to bring a restored database up-to-date. You need to locate the binary log files before you can use them.

>mysqlbinlog binlog.000001 | more
This views the events from the log.
>mysqlbinlog binlog.000001 binlog.000002 |
mysql –uroot –pPASSWORD
This execute events from the binary logs.
>mysqlbinlog --start-datetime=”2014-04-01 10:00:00”
--stop-datetime=”2014-05-01 19:00:00” binlog.000001| mysql –uroot -pPASSWORD
This executes the events in the specified time.
>mysqlbinlog --start-position=123456
--stop-position=123499 binlog.000001 |
mysql –uroot –pPASSWORD
This executes the events in the specified transaction positions.