[root@xxxx]# ll mysql-bin.* -rw-r----- 1 mysql mysql 177 Jul 3117:22 mysql-bin.000001 -rw-r----- 1 mysql mysql 177 Jul 3117:26 mysql-bin.000002 -rw-r----- 1 mysql mysql 1321 Jul 3117:36 mysql-bin.000003 -rw-r----- 1 mysql mysql 21167 Aug 2010:50 mysql-bin.000004 -rw-r----- 1 mysql mysql 76 Jul 3117:36 mysql-bin.index [root@xxxx]# cat mysql-bin.index ./mysql-bin.000001 ./mysql-bin.000002 ./mysql-bin.000003 ./mysql-bin.000004
BEGIN /*!*/; # at 21029 #20082010:50:40 server id 1 end_log_pos 21136 CRC32 0xab574d07 Query thread_id=11 exec_time=0 error_code=0 SET TIMESTAMP=1597891840/*!*/; update tt set d = 4 where c = 4 /*!*/; # at 21136 #20082010:50:40 server id 1 end_log_pos 21167 CRC32 0xdd08f243 Xid = 645 COMMIT/*!*/; # at 21167 #20082011:26:28 server id 1 end_log_pos 21232 CRC32 0xe81ffc29 Anonymous_GTID last_committed=76 sequence_number=77 rbr_only=yes /*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/; SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/; # at 21232 #20082011:26:28 server id 1 end_log_pos 21305 CRC32 0x2e084ad1 Query thread_id=11 exec_time=0 error_code=0 SET TIMESTAMP=1597893988/*!*/; BEGIN /*!*/; # at 21305 #20082011:26:28 server id 1 end_log_pos 21353 CRC32 0x13267696 Table_map: `mysql`.`tt` mapped to number 146 # at 21353 #20082011:26:28 server id 1 end_log_pos 21415 CRC32 0xf078d9cb Update_rows: table id 146 flags: STMT_END_F
BINLOG ' ZO09XxMBAAAAMAAAAGlTAAAAAJIAAAAAAAEABW15c3FsAAJ0dAADAwMDAAaWdiYT ZO09Xx8BAAAAPgAAAKdTAAAAAJIAAAAAAAEAAgAD///4FAAAAAQAAAAEAAAA+BQAAAAEAAAABQAA AMvZePA= '/*!*/; ### UPDATE `mysql`.`tt` ### WHERE ### @1=20/* INT meta=0 nullable=0 is_null=0 */ ### @2=4/* INT meta=0 nullable=1 is_null=0 */ ### @3=4/* INT meta=0 nullable=1 is_null=0 */ ### SET ### @1=20/* INT meta=0 nullable=0 is_null=0 */ ### @2=4/* INT meta=0 nullable=1 is_null=0 */ ### @3=5/* INT meta=0 nullable=1 is_null=0 */ # at 21415 #20082011:26:28 server id 1 end_log_pos 21446 CRC32 0xfa03d621 Xid = 662 COMMIT/*!*/; SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/; DELIMITER ; # End of log file /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
MySQL [mysql]> show variables like 'binlog_rows_query_log_events'; +------------------------------+-------+ | Variable_name | Value | +------------------------------+-------+ | binlog_rows_query_log_events | OFF | +------------------------------+-------+ 1row in set(0.00 sec) MySQL [mysql]> set binlog_rows_query_log_events = 'ON'; Query OK, 0rows affected(0.00 sec) MySQL [mysql]> show variables like 'binlog_rows_query_log_events'; +------------------------------+-------+ | Variable_name | Value | +------------------------------+-------+ | binlog_rows_query_log_events | ON | +------------------------------+-------+ 1row in set(0.00 sec)
[root@xxxx ]# /usr/local/mysql/mysql/bin/mysqlbinlog mysql-bin.000004 -vv --start-position=21782 --stop-position=22119 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 #20073117:36:11 server id 1 end_log_pos 123 CRC32 0xb2d914dd Start: binlog v 4, server v 5.7.24-log created 20073117:36:11 at startup # Warning: this binlog is either in use or was not closed properly. ROLLBACK/*!*/; BINLOG ' C+YjXw8BAAAAdwAAAHsAAAABAAQANS43LjI0LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAL5iNfEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA Ad0U2bI= '/*!*/; # at 21782 #20082014:37:40 server id 1 end_log_pos 21847 CRC32 0x78241dac Anonymous_GTID last_committed=78 sequence_number=79 rbr_only=yes /*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/; SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/; # at 21847 #20082014:37:40 server id 1 end_log_pos 21920 CRC32 0xf4915dd7 Query thread_id=11 exec_time=0 error_code=0 SET TIMESTAMP=1597905460/*!*/; SET @@session.pseudo_thread_id=11/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=1075838976/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; # at 21920 #20082014:37:40 server id 1 end_log_pos 21978 CRC32 0x3308d5eb Rows_query # update tt set d = 200 where id = 2 # at 21978 #20082014:37:40 server id 1 end_log_pos 22026 CRC32 0x06c85227 Table_map: `mysql`.`tt` mapped to number 146 # at 22026 #20082014:37:40 server id 1 end_log_pos 22088 CRC32 0xd1e44ca1 Update_rows: table id 146 flags: STMT_END_F
BINLOG ' NBo+Xx0BAAAAOgAAANpVAACAACJ1cGRhdGUgdHQgc2V0IGQgPSAyMDAgd2hlcmUgaWQgPSAy69UI Mw== NBo+XxMBAAAAMAAAAApWAAAAAJIAAAAAAAEABW15c3FsAAJ0dAADAwMDAAYnUsgG NBo+Xx8BAAAAPgAAAEhWAAAAAJIAAAAAAAEAAgAD///4AgAAAAIAAAAUAAAA+AIAAAACAAAAyAAA AKFM5NE= '/*!*/; ### UPDATE `mysql`.`tt` ### WHERE ### @1=2/* INT meta=0 nullable=0 is_null=0 */ ### @2=2/* INT meta=0 nullable=1 is_null=0 */ ### @3=20/* INT meta=0 nullable=1 is_null=0 */ ### SET ### @1=2/* INT meta=0 nullable=0 is_null=0 */ ### @2=2/* INT meta=0 nullable=1 is_null=0 */ ### @3=200/* INT meta=0 nullable=1 is_null=0 */ # at 22088 #20082014:37:40 server id 1 end_log_pos 22119 CRC32 0x45b08113 Xid = 670 COMMIT/*!*/; SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/; DELIMITER ; # End of log file /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;