# danfengcao/binlog2sql

Parse MySQL binlog to SQL you want

Repository: https://github.com/danfengcao/binlog2sql
Canonical: https://ross.abutalabs.com/products/binlog2sql
Language: Python
License: GPL-3.0
License Family: copyleft
Topics: binlog, flashback, mysql
Last push: 2022-04-26T17:57:35+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3560, "days_push": 1590, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3553, forks 1062 (observed 2026-08-28T04:08:09.612485+00:00)

## What it is
A Python CLI tool that parses MySQL row-format binary logs and converts them into standard SQL, rollback (flashback) SQL, or INSERT statements without primary keys. It is used for fast data recovery after accidental DML and for repairing data loss after master-slave failover.

## Use cases
- recover accidentally deleted rows in mysql
- generate rollback sql from mysql binlog
- flashback a database after a bad update
- repair data loss on new master after failover
- extract insert update delete statements from binlog
- audit who changed data in mysql

## When to choose
- you need to undo accidental DML on MySQL 5.6/5.7 with row-based binlog
- you want human-readable SQL from binlog events instead of raw binlog output
- you need point-in-time rollback SQL filtered by database, table, or SQL type

## When to avoid
- your MySQL uses statement-based binlog format or binlog_row_image is not full
- you run MySQL 8.0+ and need guaranteed compatibility or official support
- you need a GUI or continuous replication tool rather than one-off binlog parsing

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: database, parser, backup, developer-tools
- domain: databases, developer-tools
- platform: python, cli, windows
- tags: mysql, binlog, flashback, data-recovery, rollback, sql-generation, data-engineering, linux, macos

## Member repositories
- danfengcao/binlog2sql (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:09.612485+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:34:18.587063+00:00, confidence not recorded.
  - readme: https://github.com/danfengcao/binlog2sql (fetched 2026-08-28T04:08:09.612485+00:00, sha 73428c30b6e4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
