*** 71,73 **** --- 71,93 ---- $ sqlite3 <dbname> sqlite> .separator "\t" sqlite> .import <dumpfile> <tablename> + + *: MySQL to SQLite3 (shell script) + + _: A quick way to convert a MySQL DB to SQLite3 is the following shell script (it does not claim to be complete): + + #!/bin/sh + + mysqldump --compact --compatible=ansi --default-character-set=binary mydbname | + grep -v ' KEY "' | + grep -v ' UNIQUE KEY "' | + perl -e 'local $/;$_=<>;s/,\n\)/\n\)/gs;print "begin;\n";print;print "commit;\n"' | + perl -pe ' + if (/^(INSERT.+?)\(/) { + $a=$1; + s/\\'\''/'\'\''/g; + s/\\n/\n/g; + s/\),\(/\);\n$a\(/g; + } + ' | + sqlite3 output.db