Expand description
InnoDB file analysis toolkit.
The innodb-utils crate (library name idb) provides Rust types and
functions for parsing, inspecting, and manipulating InnoDB tablespace
files (.ibd), redo log files, and system tablespace data (ibdata1).
§CLI Reference
Install the inno binary and use its subcommands to work with InnoDB
files from the command line.
§Installation
cargo install innodb-utils # crates.io
brew install ringo380/tap/inno # Homebrew (macOS/Linux)Pre-built binaries for Linux and macOS (x86_64 + aarch64) are available on the GitHub releases page.
§Subcommands
| Command | Purpose |
|---|---|
inno parse | Parse .ibd file and display page summary |
inno pages | Detailed page structure analysis (INDEX, UNDO, LOB, SDI) |
inno dump | Hex dump of raw page bytes |
inno checksum | Validate page checksums (CRC-32C and legacy) |
inno corrupt | Intentionally corrupt pages for testing |
inno recover | Assess page-level recoverability and count salvageable records |
inno find | Search data directory for pages by number |
inno tsid | List or find tablespace IDs |
inno sdi | Extract SDI metadata (MySQL 8.0+) |
inno log | Analyze InnoDB redo log files |
inno info | Inspect ibdata1, compare LSNs, query MySQL |
§Global options
All subcommands accept --color <auto|always|never> and --output <file>.
Most subcommands also accept --json for machine-readable output and
--page-size to override auto-detection.
See the cli module for full details.
§Library API
Add idb as a dependency to use the parsing library directly:
[dependencies]
idb = { package = "innodb-utils", version = "1" }§Quick example
use idb::innodb::tablespace::Tablespace;
use idb::innodb::checksum::validate_checksum;
use idb::innodb::page::FilHeader;
// Open a tablespace (page size is auto-detected from page 0)
let mut ts = Tablespace::open("table.ibd").unwrap();
// Read and inspect a page
let page = ts.read_page(0).unwrap();
let header = FilHeader::parse(&page).unwrap();
println!("Page type: {}", header.page_type);
// Validate the page checksum
let result = validate_checksum(&page, ts.page_size());
println!("Checksum valid: {}", result.valid);§Key entry points
| Type / Function | Purpose |
|---|---|
Tablespace | Open .ibd files, read pages, iterate |
FilHeader | Parse the 38-byte header on every InnoDB page |
PageType | Map page type codes to names and descriptions |
validate_checksum | CRC-32C and legacy checksum validation |
extract_sdi_from_pages | SDI metadata extraction (MySQL 8.0+) |
LogFile | Read and inspect redo log files |
§Module overview
| Module | Purpose |
|---|---|
innodb::tablespace | File I/O, page size detection, page iteration |
innodb::page | FIL header/trailer, FSP header parsing |
innodb::page_types | Page type enum with names and descriptions |
innodb::checksum | CRC-32C and legacy InnoDB checksum algorithms |
innodb::index | INDEX page internals (B+Tree header, FSEG) |
innodb::record | Row-level record parsing (compact format) |
innodb::sdi | SDI metadata extraction and decompression |
innodb::log | Redo log file structure and block parsing |
innodb::undo | UNDO log page structures |
innodb::lob | Large object (BLOB/LOB) page headers |
innodb::compression | Compression detection and decompression |
innodb::encryption | Encryption detection from FSP flags |
innodb::constants | InnoDB page/file structure constants |
§Feature flags
| Feature | Default | Description |
|---|---|---|
mysql | off | Enables live MySQL queries via mysql_async + tokio (used by inno info). |
Modules§
- cli
- CLI subcommand implementations for the
innobinary. - innodb
- InnoDB binary format parsing.
- util
- Shared utilities (hex dump formatting, filesystem helpers, optional MySQL connectivity).
Enums§
- IdbError
- Errors returned by
idboperations.