Converts MySQL dump to SQLite3 compatible dump
Switch branches/tags
Nothing to show
Clone or download
dumblob Merge pull request #43 from colmmcmullan/master
Add support for REPLACE statements (sqlite supports it as an alias of INSERT OR REPLACE).
Latest commit 3e05e81 Sep 12, 2018


Converts MySQL dump to SQLite3 compatible dump (including MySQL KEY xxxxx statements from the CREATE block).


  1. Dump MySQL DB

    mysqldump --skip-extended-insert --compact [options]... DB_name > dump_mysql.sql
    # or
    #mysqldump --no-data -u root -pmyPassword [options]... DB_name > dump_mysql.sql
  2. Convert the dump to SQLite3 DB

    ./mysql2sqlite dump_mysql.sql | sqlite3 mysqlite3.db


The script is written in awk (tested with gawk, but should work with original awk, and the lightning fast mawk) and shall be fully POSIX compliant.

It's originally based on the newest fork ( of the original ( with the following patches:

Feel free to contribute (preferably by issuing a pull request)!




  • @esperlu created initial version in 2011 as gist on GitHub
  • many different contributors forked the gist and made wildly varying changes, because @esperlu stopped working on it and didn't respond
  • @dumblob took over in Aug 2015 and applied the most important patches from all the forks as well as many his own patches tested on Drupal DB
  • @dumblob added the MIT license under assumption, that the original gist was released into public domain, because despite significant changes, it wasn't clean room engineering.
  • 2016-05-11 17:32 UTC+2 @esperlu declared MIT as a fitting license (also retrospectively) and the original gist as deprecated.