Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert mysql to sqlite3 using PHP

Tags:

php

sqlite

mysql

I have a database on mysql server. I want to convert that to sqlite3 database without using shell or perl scripts. I want some help converting the same using PHP. Any Help would be appreciated.

like image 956
aToz Avatar asked May 19 '26 02:05

aToz


1 Answers

Using PHP only would be rather troublesome, you'd have to get all the records from your mysql table, create the appropriate tables in sqlite3 and insert the records.

As far as I can tell you just want to to it automatically, so I would'nt see the harm in using shell programs. You could quite easily do this using the exec function: https://www.php.net/manual/en/function.exec.php

like image 164
Jeroen Avatar answered May 21 '26 15:05

Jeroen



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!