I have an export SQL file containing tables and data from MySQL and I want to import it into a Sqlite 3 DB.
What is the best way to do that?
Just importing t
At least, with mysql 5.0.x, I had to remove collate utf8_unicode_ci from mysql's dump before importing it to sqlite3. So I modified the script to include the following to the list of seds:
sed 's/ collate utf8_unicode_ci/ /g' |
Update:
MySQL treats boolean fields as "tinyint(1)", so I had to add the following before tinyint([0-9]*) sed:
sed 's/ tinyint(1) / boolean /g' |
Also, since I'm trying to replicate a mysql db (production) to a sqlite3 db (development) of a Ruby On Rails application, I had to add the following line in order to set an auto-incrementing primary key:
sed 's/) NOT NULL/) PRIMARY KEY AUTOINCREMENT NOT NULL/g' |
I'm still trying to figure out a way to change the KEY entries from mysql to its corresponding CREATE INDEX entry of sqlite3.