Ted
Ted

Reputation: 31

Can I use sqllite with a mySQL backup file?

If i wanted to use a mySQL database offline, could i download it from a server and SELECT from it when i am offline? That way I could use the version on the server when online, and use the local copy when offline.

i want to do something like this:

sql_con = new SQLiteConnection("Data Source=MySQLDB.sql") 

Upvotes: 0

Views: 289

Answers (2)

Larry Lustig
Larry Lustig

Reputation: 51000

If you want to use your MySQL database offline, it would be much easier for you to run a second instance of the MySQL server software on your own computer. Replicate the server database on your computer and then, when you want to use the local copy, attach to the local MySQL instance.

Upvotes: 1

Seva Alekseyev
Seva Alekseyev

Reputation: 61388

MySQL and SQLite are two completely different databases with wildly different file formats. So straight file reuse is not an option. You can, however, export the database from MySQL in SQLite-friendly format (like CSV, or straight-out SQL), and import that into SQLite. There will be some coding involved, most likely.

Upvotes: 0

Related Questions