MySQL to SQLite3¶
A Python CLI for transferring MySQL or MariaDB schema and data to a SQLite 3 database file.
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-datato create schema only.Use
--without-tablesto transfer data into an existing SQLite schema.Use
--mysql-tablesor--exclude-mysql-tablesto transfer a table subset; this disables foreign key transfer.Use
--mysql-ssl-ca,--mysql-ssl-cert, and--mysql-ssl-keyfor certificate-based MySQL connections.
See Usage for full recipes, option notes, and MySQL/MariaDB caveats.