Export MySQL database to SQLite

3

I usually use a database in applications that I develop locally.

With mysql whenever I need to clone the application to another machine, I need to generate a dump of the database and import it to the local database again. I think I could eliminate some unnecessary effort by using a SQLite base that would be stored in the repository along with the application files.

How do I convert / export a MySQL database to a SQLite file?

If you can do prompt of mysql or linux better.

I believe that versioning the database in this way may not be recommended in cases where more than one person is manipulating the database data. But that will not be a problem in my specific case.

    
asked by anonymous 05.02.2014 / 17:57

1 answer

3

Try the mysql2sqlite.sh script : link

p>

As described in the header, how to use:

./mysql2sqlite.sh myDbase | sqlite3 database.sqlite

If you have Ruby installed you can do the following, use the Sequel package through this command and then run it:

  $ gem install sequel
  $ sequel mysql://user:password@host/database -C sqlite://db.sqlite
    
05.02.2014 / 19:18