converting MySQL to SQLite

I’m looking for some easy method to convert my SQL database to SQLite database so it can be packed int ZIP file and downloaded. further I plan to use this database on the mobile device.
My database resides on HostGator server running Cent/OS + Apache. I would like to havean App, where upon user request (pressing abutton) the curent database is converted into SQLite. Preferably I would like to be able to select tables for conversion but the whole database will do the job as well.
Are there any examples, scripts, applications I could lookup or borrow the code ?

Thanks - Arthur

Unfortunately there’s no ‘easy’ method. But some things you might consider. On the web you’ll find loads of samples to export you tables to csv from MySQL. If you search on this forum you will find a sample as this issue was here not so long ago. (I posted some samplecode). It’s pretty the same thing to import the csv into another database. If you use a db tool like phpMyAdmin you are able to generate sql for dumping things which you can use to make your create-table scripts. I think that if you are that far you won’t find much problems then.

Another nice sample might be: http://www.matteomattei.com/en/export-mysql-table-in-csv-format-using-php/

with fgetcsv you can read the csv in one time and create your database.

hope this helps.

Check out dbconvert and altova, esf database (to name just a few). Their tools do most of the work for you. Even dbcvt (sourceforge) does part of the work…

thanks, I will test it…
Arthur

Quick one here please Aka, before the conversion, did you back you your MySQL database first? I’d like to know what application you used here and how it went out for you.