Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am saady on github.
  • I am ysaady (https://keybase.io/ysaady) on keybase.
  • I have a public key ASD1Ss6VZMJKb4UhD4G0fDxO2Bx33SOjr4W3sHdF4b4jJwo

To claim this, I am signing this object:

#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite