Comments on: On SHOW BINLOG/RELAYLOG EVENTS https://shlomi-noach.github.io/blog/mysql/on-show-binlogrelaylog-events Blog by Shlomi Noach Sun, 09 Aug 2015 07:57:31 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: Daniël van Eeden https://shlomi-noach.github.io/blog/mysql/on-show-binlogrelaylog-events/comment-page-1#comment-322950 Sun, 09 Aug 2015 07:57:31 +0000 https://shlomi-noach.github.io/blog/?p=7237#comment-322950 It is possible to get info about RBR events with binlog_rows_query_log_events.

mysql-5.6.25-log > CREATE TABLE mytable1 (id int auto_increment primary key, name varchar(100));
Query OK, 0 rows affected (0.02 sec)

mysql-5.6.25-log > INSERT INTO mytable1(name) VALUES(‘test1′);
Query OK, 1 row affected (0.01 sec)

mysql-5.6.25-log > SET binlog_format=’ROW’;
Query OK, 0 rows affected (0.00 sec)

mysql-5.6.25-log > INSERT INTO mytable1(name) VALUES(‘test2’);
Query OK, 1 row affected (0.00 sec)

mysql-5.6.25-log > SET binlog_rows_query_log_events=ON;
Query OK, 0 rows affected (0.00 sec)

mysql-5.6.25-log > INSERT INTO mytable1(name) VALUES(‘test3’);
Query OK, 1 row affected (0.01 sec)

mysql-5.6.25-log > SHOW BINLOG EVENTS;
┌───────────────┬─────┬─────────────┬───────────┬─────────────┬──────────────────────────────────────────────────────────────────────────────────────────┐
│ Log_name │ Pos │ Event_type │ Server_id │ End_log_pos │ Info │
├───────────────┼─────┼─────────────┼───────────┼─────────────┼──────────────────────────────────────────────────────────────────────────────────────────┤
│ binlog.000001 │ 4 │ Format_desc │ 10 │ 120 │ Server ver: 5.6.25-log, Binlog ver: 4 │
│ binlog.000001 │ 120 │ Query │ 10 │ 270 │ use `test`; CREATE TABLE mytable1 (id int auto_increment primary key, name varchar(100)) │
│ binlog.000001 │ 270 │ Query │ 10 │ 349 │ BEGIN │
│ binlog.000001 │ 349 │ Intvar │ 10 │ 381 │ INSERT_ID=1 │
│ binlog.000001 │ 381 │ Query │ 10 │ 497 │ use `test`; INSERT INTO mytable1(name) VALUES(‘test1’) │
│ binlog.000001 │ 497 │ Xid │ 10 │ 528 │ COMMIT /* xid=141 */ │
│ binlog.000001 │ 528 │ Query │ 10 │ 600 │ BEGIN │
│ binlog.000001 │ 600 │ Table_map │ 10 │ 654 │ table_id: 100 (test.mytable1) │
│ binlog.000001 │ 654 │ Write_rows │ 10 │ 700 │ table_id: 100 flags: STMT_END_F │
│ binlog.000001 │ 700 │ Xid │ 10 │ 731 │ COMMIT /* xid=143 */ │
│ binlog.000001 │ 731 │ Query │ 10 │ 803 │ BEGIN │
│ binlog.000001 │ 803 │ Rows_query │ 10 │ 869 │ # INSERT INTO mytable1(name) VALUES(‘test3’) │
│ binlog.000001 │ 869 │ Table_map │ 10 │ 923 │ table_id: 100 (test.mytable1) │
│ binlog.000001 │ 923 │ Write_rows │ 10 │ 969 │ table_id: 100 flags: STMT_END_F │
│ binlog.000001 │ 969 │ Xid │ 10 │ 1000 │ COMMIT /* xid=145 */ │
└───────────────┴─────┴─────────────┴───────────┴─────────────┴──────────────────────────────────────────────────────────────────────────────────────────┘
15 rows in set (0.00 sec)

]]>