![]() ![]() ![]() Multiple queries, with small result sets, need toįirst, you need this script (put it into a file called 'mysql-to-sqlite.sh'): #!/bin/bash use-buffered-cursors Use MySQLCursorBuffered for reading the MySQLĭatabase. ![]() V, -vacuum Use the VACUUM command to rebuild the SQLiteĭatabase file, repacking it into a minimal amount c, -chunk INTEGER Chunk reading/writing SQL records d, -mysql-database TEXT MySQL database name f, -sqlite-file PATH SQLite3 database file Here's how you use it: Usage: mysql2sqlite It is invokable via command line but can also be used as a standard Python class which you can include in some larger Python orchestration. The tool is also thoroughly tested and works on Python 2.7 and 3.5+. I also put in some effort to correctly translate most of the datatypes from MySQL to SQLite. It uses generators and chunking of the data being processed and is therefore very memory efficient. ![]() The upside of it being written in Python is that it's cross platform (unlike a shell/bash script) and can all be easily installed using pip install (even on Windows). It was by no means an easy task and I ended up writing this Python package that does the job. I faced the same problem about 2 days ago when I had to convert a 20GB+ MySQL database to SQLite. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |