2

I have MySQL on my server and different SQLite databases on a client. I'm trying to find a way to create the same databases on the server.

Since a SQLite schema is actually a CREATE query, one way would be to write a script that extracts every critical part from the create query and converts them into a corresponding MySQL query, finally concatenate them all.

This seems quite a complex and hard-to-cover-all-situations method. I am wondering if there is any alternatives?

Hannah Vernon
71.1k22 gold badges178 silver badges324 bronze badges
asked Sep 30, 2012 at 22:53
0

1 Answer 1

1

The three main things to change are:

  • Change AUTOINCREMENT to AUTO_INCREMENT
  • Replace double-quotes around database, table and variable names with backticks
  • Delete any lines with "sqlite_sequence" in them

You should then be able to run the SQL file in MySQL. If you encounter any errors, the fix should be apparent from the error message shown.

answered Mar 1, 2013 at 22:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.