Mysql binlog3 formats: row, mixed, and statement. Parsing
Mysqlbinlog -- base64-output = DECODE-ROWS-v mysql-bin.000144 | more
-- Base64-output = DECODE-ROWS: displays the SQL changes brought about by row mode.
-V: displays SQL statements in statement mode.
Copy codeThe Code is as follows:
[Mysql @ 002tmp] $ mysqlbinlog -- base64-output = DECODE-ROWS-v mysql-bin.000144 | more
/*! 40019 SET @ session. max_insert_delayed_threads = 0 */;
/*! 50003 SET @ OLD_COMPLETION_TYPE = @ COMPLETION_TYPE, COMPLETION_TYPE = 0 */;
DELIMITER /*! */;
# At 4
#140216 23:59:26 server id 3 end_log_pos 107 Start: binlog v 4, server v 5.5.25a-log created 140216 23:59:26
# At 107
#140216 23:59:26 server id 1 end_log_pos 171 Query thread_id = 8557964 exec_time = 0 error_code = 0
Set timestamp = 1392595166 /*! */;
SET @ session. pseudo_thread_id = 8557964 /*! */;
SET @ session. foreign_key_checks = 1, @ session. SQL _auto_is_null = 0, @ session. unique_checks = 1, @ session. autocommit = 1 /*! */;
SET @ session. SQL _mode = 6291456 /*! */;
SET @ session. auto_increment_increment = 2, @ session. auto_increment_offset = 1 /*! */;
/*! \ C utf8mb4 *//*! */;
SET @ session. character_set_client = 45, @ session. collation_connection = 45, @ session. collation_server = 33 /*! */;
SET @ session. lc_time_names = 0 /*! */;
SET @ session. collation_database = DEFAULT /*! */;
BEGIN
/*! */;
# At 171
# At 260
#140216 23:59:26 server id 1 end_log_pos 260 Table_map: 'billing'. 'billing _ account' mapped to number 216
#140216 23:59:26 server id 1 end_log_pos 418 Write_rows: table id 216 flags: STMT_END_F
### Insert into billing. billing_account
### SET
###@ 1 = 80491
###@ 2 = 1000013580491
###@ 3 = 1000056980491
###@ 4 = 1
###@ 5 = 1
###@ 6 = 'integration-tests'
###@ 7 = 23:59:26
###@ 8 = 'integration-tests'
###@ 9 = 23:59:26
###@ 10 = 'integration-tests'
###@ 11 = NULL
###@ 12 = '0'
###@ 13 = 1000105380491
###@ 14 = '0'
###@ 15 = '192. 153.208.254'
###@ 16 = 1
###@ 17 = NULL
# At 418
# At 516
#140216 23:59:26 server id 1 end_log_pos 516 Table_map: 'billing'. 'credit _ card_account 'mapped to number 222
#140216 23:59:26 server id 1 end_log_pos 812 Write_rows: table id 222 flags: STMT_END_F
### Insert into billing. credit_card_account
### SET