954,176 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Converting MySQL tables to SQLite

Does any one know how to use SQLite? Can anyone tell me how to convert populated MySQL tables to SQLite tables without using a DBConvert software?

ChPravin
Light Poster
49 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 
Does any one know how to use SQLite? Can anyone tell me how to convert populated MySQL tables to SQLite tables without using a DBConvert software?

You could use mysqldump on the MySQL DB and create a plain SQL file from that. Then you could make this SQL file SQLite compatible using whatever text editor you like (vi, nedit, emacs, ...), this would basically be just the removal of some MySQL specials like COLLATION, the storage engine and so on. Global search / replace will do that for you.

In addition you might want to split the CREATE TABLE section and the INSERT INTO section into two separate files.

Then fire up sqlite and source the create table SQL file first and then the insert into file.

maba001
Junior Poster in Training
60 posts since Jun 2008
Reputation Points: 9
Solved Threads: 9
 

Thanks for the reply!

ChPravin
Light Poster
49 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You