Friday, December 6, 2013

How to convert MySQL to SQLite

My projects needed SQLite file.
My database in MySQL has to be converted into SQLite.

So, searched into google and gone over threads of different forums,
finally, I was able to make SQLite.

links when I searched,

./ -u root --default-character-set=utf8 MySQL_db | sqlite3 SQLite_db.sqlite
#learned from

As this code needs, from GitHub
Copy to C:\cygwin\bin

2.In cygwin, Copy
mysqldump.exe from C:\xampp\mysql\bin to C:\cygwin\bin

3.sqlite3 downloaded from according to your OS)
and copy
sqlite3.exe to C:\cygwin\bin

4.Start Apache and MySQL Services from Xampp C:\xampp\xampp-control.exe

5.Run mintty/cygwin/bash
run this command to make file executable learned from
chmod +x

and the final command to convert MySQL to SQLite
./ -u root --default-character-set=utf8 MySQL_db | sqlite3 SQLite_db.sqlite

// -u root ===> your localhost
//--default-character-set=utf8 ===> to make unicode
//MySQL_db ===> MySQL Database name(db from phpMyAdmin)
//SQLite_db.sqlite ===> SQLite database which is saved into the same directory C:\users\user(see by pwd for address)

this should convert your MySQL database to SQLite in you C:\Users\user directory.
or pwd for the path.

Thank you for your visit.

No comments:

Post a Comment