SQLite3 to MySQL¶
A Python CLI for transferring SQLite 3 schema and data to MySQL or MariaDB.
Installation¶
pip install sqlite3-to-mysql
Basic Usage¶
Use the password prompt for interactive use:
sqlite3mysql -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
--mysql-skip-transfer-datato create schema only.Use
--mysql-skip-create-tablesto transfer data into an existing MySQL schema.Use either table filter (
--sqlite-tablesor--exclude-sqlite-tables) to 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.