https://github.com/sinri/binlogreader
Plan to read MySQL Binlog Binary Files!
https://github.com/sinri/binlogreader
Last synced: about 1 year ago
JSON representation
Plan to read MySQL Binlog Binary Files!
- Host: GitHub
- URL: https://github.com/sinri/binlogreader
- Owner: sinri
- Created: 2020-01-13T06:26:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T07:06:36.000Z (almost 6 years ago)
- Last Synced: 2025-01-29T18:33:34.498Z (over 1 year ago)
- Language: PHP
- Size: 114 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BinlogReader
Now it may parse the binlog file of MySQL 5.6.
Higher versions are not tested yet.
# File Structure of MySQL Binlog File (v4)
1. Magic Words (`\xfe\x62\x69\x6e`)
2. Events
* Events start with Format Description Event and End with Rotate Event;
* Structure of each event
1. Header (19 bytes)
1. timestamp (4 bytes)
2. type code (1 bytes)
3. server id (4 bytes)
4. event length (4 bytes)
5. next position (4 bytes);
6. flags (2 bytes)
2. Body (size is event length - checksum size)
* structure varies amongst different events
3. Checksum (empty or 4 bytes if CRC32 method used)