View Binary Log Contents
When restoring the database, you may not want to apply an entire incremental backup file if you suspect it contains corrupted database operations. View the contents of the binary log to identify valid events.
To view binary log events, you must use the MySQL
mysqlbinlog
utility. The utility converts the binary file
contents to text form. See the mysqlbinlog
utility reference for
complete details.
The following shows an example of the binary log content:
$ mysqlbinlog stadb-bin.000016 | more
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160125 17:03:36 server id 1 end_log_pos 120 CRC32 0x2a76ef3b Start: binlog v 4, server v 5.6.18-enterprise-commercial
-advanced-log created 160125 17:03:36
BINLOG '
2LemVg8BAAAAdAAAAHgAAAAAAAQANS42LjE4LWVudGVycHJpc2UtY29tbWVyY2lhbC1hZHZhbmNl
ZC1sb2cAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAATvv
dio=
'/*!*/;
# at 120
--More--