Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Converts MySQL dump to SQLite3 compatible dump

License

NotificationsYou must be signed in to change notification settings

mysql2sqlite/mysql2sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Converts MySQL dump to SQLite3 compatible dump (including MySQLKEY xxxxx statements from theCREATE 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

(bothmysql2sqlite andsqlite3 might write something to stdout and stderr - e.g.memory coming fromPRAGMA journal_mode = MEMORY; is not harmful)

Development

The script is written inawk (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 originalmysql2sqlite.sh (https://gist.github.com/esperlu/943776/be469f0a0ab8962350f3c5ebe8459218b915f817) with the following patches:

Feel free tocontribute (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 theoriginal gist as deprecated.

About

Converts MySQL dump to SQLite3 compatible dump

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors12


[8]ページ先頭

©2009-2025 Movatter.jp