MySQL to SQLite3

A Python CLI for transferring MySQL or MariaDB schema and data to a SQLite 3 database file.

PyPI PyPI - Downloads Homebrew Formula Downloads PyPI - Python Version MySQL Support MariaDB Support GitHub license Contributor Covenant PyPI - Format Code style: black Codacy Badge Test Status CodeQL Status Publish PyPI Package Status codecov GitHub Sponsors GitHub stars

Installation

pip install mysql-to-sqlite3

Basic Usage

Use the password prompt for interactive use:

mysql2sqlite -f ./app.sqlite3 -d app_db -u app_user -p -h 127.0.0.1 -P 3306

Tested Databases

See the GitHub Actions CI matrix for the current MySQL and MariaDB versions tested by the project.

Common Tasks

  • Use --without-data to create schema only.

  • Use --without-tables to transfer data into an existing SQLite schema.

  • Use --mysql-tables or --exclude-mysql-tables to transfer a table subset; this disables foreign key transfer.

  • Use --mysql-ssl-ca, --mysql-ssl-cert, and --mysql-ssl-key for certificate-based MySQL connections.

See Usage for full recipes, option notes, and MySQL/MariaDB caveats.

Indices and tables