3

Can anyone let me know how we can convert .sql database file into .sqlite file in mac.

Thanks in advance.

9
  • 1
    Hi Graham, we tried what you said but its not working Commented May 16, 2011 at 19:38
  • 1
    Hi Chris, yes it is a script with create and insert statements. Commented May 16, 2011 at 19:58
  • 1
    Hi Chris, no idea about DBMS as its given by client but .sql file have been generated through PHP Version: 5.2.4. Thanks. Commented May 16, 2011 at 20:19
  • 1
    Hi Chris, we looked into your link which you send the problem is the unique key as well as primary key we cant get these in our .sql file as it is encrypted. We want to ask for one more favour will it be possible for you to import the file if we send you the file. Commented May 16, 2011 at 21:48
  • 2
    This question is similar to: How to import load a .sql or .csv file into SQLite?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Aug 6 at 12:43

1 Answer 1

1

The way this is done depends on your DBMS, however generally speaking there are the following steps:

  1. Create a Dump File out of your SQL-Database. A dump file contains all sql-statements needed to recreate that same SQL-Database on another machine.
  2. Check if your source DBMS does contain SQL-Syntax not supported in SQLite. The documentation for SQLite https://sqlite.org/lang.html is the main source for this task. Notepad++ or other text editors are a helpful tool here. Also the moment you try to read in your MySQL-Dump in SQLite you will get an error traceback highlighting not supported keywords.
  3. Craft the SQL-Dump so that it only contains SQL-Statements supported by SQLite.

Note that crafting portable SQL is a very hard and time consuming task and you might loose some functions compared to the source database.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.