Parsing MySQL Binlog--(2) format_description_event

Source: Internet
Author: User

This format describes the event that was introduced in Binlog version 4 in order to replace the previous release of the Start_event_3 event. Is the first event of the Binlog file and appears only once in a Binlog file. Specific definition:

Binlog-version:binlog version
Mysql-server Version: Server versions
Create timestamp: Indicates when the Binlog file was created. If the binlog is caused by a switchover, then the field is 0
Event Header length:189
Event Type header lengths: Records the length of the private event header for all events, the number of event definitions 5.6,5.7 is 40, which is 40 bytes

[[email protected] data]$ HEXDUMP-CV mysql-bin.000002 > 2.txt [[email protected] data]$ VI 2.txt 00000000 Fe 6e c4 A4 5a 0f 0b 00 00 00 74 00 00 |. Binf.  z.....t..| 00000010 (XX), 2e 2e, 2d |. X.......  5.6.26-|  00000020 2d 6c 6f, XX, xx, xx xx |debug-log.......|  00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040, XX, xx, xx, C4 a4 5a 13 | ....... F..  z.|  00000050 0d (5c 00 |8.............\.|) at the XX  00000060 1a, xx xx, 0a 0a 0a |................| 00000070 (C8 A1 C5) C4 A4 5a 0b xx |........b.  z....| 00000080 (XX): BF 00 00 00 08 00 01 00 00 00 00 |.  g..............|  00000090 (XX) 1a 00 00 00 00 00 00 01 00 00 |................| 000000a0 00 40 00 00 00 00 06 03 73 74 64 04 21 00 21 00 | [Email protected]!.!.| 000000b0 7a (4e), 8c BA 62 |!. Yzs.  begin0...b| 000000c0 c4 A4 5a 0b xx xx xx 00 00 00 |  Z ...-....... | 000000d0 (XX): 7a 73 00 02 | In each of the xx xx   f........yzs..|

Analysis:

1, beginning 4 bytes Binlog Magic Number:fe 6e, that is. bin

2, the first Binlog event is format_description_event.

3, timestamp:46 C4 A4 5a, that is, small end display 0x5aa4c446, decimal 1520747590,
[Email protected] data]$ date-d "@1520747590"
Sat Mar 21:53:10 PST 2018

Binlog Parse Time is: #180310 21:53:10 server ID end_log_pos CRC32 0x19c5a1c8 start:binlog v 4, server v 5.6.26-debug-log C reated 180310 21:53:10 at startup
3, Event type:0f, that is, 15

5, server-id:0b 00 00 00, that is, the small end display 0x00 0b, that is, 11

6, Event size:74 00:0x 00 00 00 74,116. 120-4 (. bin)

7, Next-log pos:78 xx 00:0x00 00 00 78,120, the next event location, relative to the file header location, and End_log_pos 1201 to

8, flag:01 00; for 0x0001 then, in the Mysqlbinlog output, report a warning that this binlog is not closed

9, Binlog version:04 00, small-end display and 0x0004, and Mysqlbinlog in the resolution Start:binlog v 4 consistent

10. mysql server Version:5.6.26-debug-log, the remaining byte 0 is populated

00000010                              35 2e 36 2e 32 36 2d  |.x.......5.6.26-|  00000020  64 65 62 75 67 2d 6c 6f  67 00 00 00 00 00 00 00  |debug-log.......|  00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|  00000040  00 00 00 00 00 00 00 00  00 00 00   

11, create stamp:46 C4 A4 5a, and the same as the event header

12, Event header length:13, that is, 19 bytes

13. Event Header lengths:array[30]-[32]:0a 0a 0a, write_rows_event = 30,update_rows_event = Delete_rows_event = 32 private Event Header Length

00000050  38 0d 00 08 00 12 00 04  04 04 04 12 00 00 5c 00  |8.............\.|  00000060  04 1a 08 00 00 00 08 08  08 02 00 00 00 0a 0a 0a  |................|  00000070  19 19 00 01 c8 a1 c5 19  

Reference: http://blog.itpub.net/7728585/viewspace-2133189/

Parsing MySQL Binlog--(2) format_description_event

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.