mysql2sqlite

Converts MySQL dump to SQLite3 compatible dump

  • Owner: dumblob/mysql2sqlite
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

mysql2sqlite

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

Usage

  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
    

(both mysql2sqlite and sqlite3 might write something to stdout and stderr - e.g. memory coming from PRAGMA journal_mode = MEMORY; is not harmful)

Development

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 (https://gist.github.com/bign8/9055981/05e65fd90c469c5eaa730823910c0c5f9de40ab4) of the original mysql2sqlite.sh (https://gist.github.com/esperlu/943776/be469f0a0ab8962350f3c5ebe8459218b915f817) with the following patches:

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

License

MIT

History

  • @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.

Main metrics

Overview
Name With Ownerdumblob/mysql2sqlite
Primary LanguageAwk
Program languageAwk (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2024-03-31 20:26:02
Pushed At2023-10-04 15:19:47
Last Commit At2020-09-01 17:25:16
Release Count0
用户参与
Stargazers Count88
Watchers Count4
Fork Count5
Commits Count54
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count0
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private