Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

sqlite

mysql

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

like image 824
Sandy Avatar asked Jan 23 '26 16:01

Sandy


1 Answers

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!

like image 60
Kuf Avatar answered Jan 26 '26 09:01

Kuf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!