How can I convert the MySQL database (.sql) file to a SQLite file in PHP?

advertisements

I have a MYSQL database dump file in ".sql" format but I have required "SQLite" file, is it possible to convert .sql file into SQLite file using php script or any other way?

I have also tried shell script code but this script create only file with 0 bytes.

Thanks 2 all


Basically, the dump file contains the table building data and the rows to be inserted. In most cases the INSERT commands should work on SQLlite, but the table building might need to be modified. The exact needed changes depends how did you get your sql dump file (in which utility, version, definition, etc.). I suggest you try to import it directly and handle the errors one by one. Than you could write your own conversion script.

If your having any problems paste the problematic parts of the dump file here.

Good luck!