Forensicsmdbaccessdatabasejetsqlcsvexportimport

mdbtools

mdbtools provides utilities for reading, manipulating, and exporting data from Microsoft Access (MDB) database files. It includes command-line tools for schema dumping, data export to CSV/JSON, SQL querying, and file analysis.

Description

mdbtools is a collection of tools designed to work with JET / MS Access database (MDB) files. The main package offers various command-line utilities for listing tables, exporting schema and data, running SQL queries, and inspecting file properties. Supporting libraries like libmdb3t64 and libmdbsql3t64 enable programmatic access and SQL engine functionality, allowing integration with languages like PHP or ODBC drivers.

Use cases include forensic analysis of Access databases, data migration to other formats like CSV or JSON, schema reverse engineering, and querying legacy MDB files without Microsoft Access. Tools like mdb-export, mdb-sql, and mdb-tables facilitate extraction and examination in security investigations or data recovery scenarios.

Additional packages provide development files, ODBC support, and deprecated utilities for specialized C code generation, though some tools like mdb-array and mdb-header are marked for future removal.

How It Works

mdbtools parses the JET database format used by Microsoft Access, reading binary structures like tables, schemas, queries, and pages. Core library libmdb3t64 handles file access and data types, while libmdbsql3t64 provides a SQL engine for query processing. Utilities leverage these libraries to dump headers, export rows with customizable delimiters/quoting, execute SQL via mdb-sql, or hex-dump binary content. Environment variables like MDB_JET3_CHARSET and MDBOPTS control charset conversion and debugging.

Installation

bash
sudo apt install mdbtools

Flags

-H, --no-headerSuppress header row (mdb-export)
-d, --delimiter=charSpecify an alternative column delimiter. Default is comma (mdb-export)
-Q, --no-quoteDon't wrap text-like fields in quotes (mdb-export)
-S, --systemInclude system tables (mdb-tables)
-L, --listList queries in the database (mdb-queries)
-T, --table=tableOnly create schema for named table (mdb-schema)
-i, --input=fileRead SQL from specified file (mdb-sql)
-H, --header linesSkip lines of CSV header (mdb-import)

Examples

Export data in an MDB database table to a C array (deprecated)
mdb-array <file> <table>
Print the number of records in an Access database table
mdb-count [OPTION…] <file> <table>
Export data from MDB file to CSV format
mdb-export [OPTION…] <file> <table>
Show MDB files tables/entries
mdb-tables [OPTION…] <file>
Run SQL queries interactively on MDB file
mdb-sql [OPTION…] <file>
Dump schema creation DDL
mdb-schema [OPTION…] <file> [<backend>]
Display MDB file version/format
mdb-ver [OPTION…] <file>
Make a hex dump of an MDB file
mdb-hexdump file [pagenumber]
Updated 2026-04-16kali.org ↗