patternsqlModerate
Show sql statements from mysql binlog (GTID)
Viewed 0 times
showgtidsqlstatementsmysqlfrombinlog
Problem
I have mysql binlogs for replication through GTID.
I'm trying to show executed update/insert statements like this:
But all I see is something like this, no traces of update or insert stmt:
I'm not sure about format/configuration of GTID replication and where to look for it...
I'm trying to show executed update/insert statements like this:
mysqlbinlog --base64-output=DECODE-ROWS mysql-bin.000024But all I see is something like this, no traces of update or insert stmt:
SET TIMESTAMP=1431681617/*!*/;
BEGIN
/*!*/;
# at 746987321
# at 746987392
# at 746987484
#150515 11:20:17 server id 1 end_log_pos 746987515 CRC32 0xeb874754 Xid = 997501767
COMMIT/*!*/;
# at 746987515
#150515 11:20:22 server id 1 end_log_pos 746987563 CRC32 0xc5ece64a GTID [commit=yes]
SET @@SESSION.GTID_NEXT= 'a4ade293-c63a-11e4-94cf-005056944a56:2059057'/*!*/;
# at 746987563
#150515 11:20:22 server id 1 end_log_pos 746987650 CRC32 0x92296355 Query thread_id=71622 exec_time=0 error_code=0I'm not sure about format/configuration of GTID replication and where to look for it...
Solution
It seems that the option --verbose must be added:
In the result you see:
@x are the table columns in their order
mysqlbinlog --base64-output=AUTO --verbose mysql-bin.000005In the result you see:
### UPDATE `customer`
### WHERE
### @1=388442
### @2=382023
### @3='2015:05:30'
### @4='2015:06:02'
### @5=3
### @6=1
### @7=0@x are the table columns in their order
Code Snippets
mysqlbinlog --base64-output=AUTO --verbose mysql-bin.000005### UPDATE `customer`
### WHERE
### @1=388442
### @2=382023
### @3='2015:05:30'
### @4='2015:06:02'
### @5=3
### @6=1
### @7=0Context
StackExchange Database Administrators Q#101651, answer score: 14
Revisions (0)
No revisions yet.