开发者

Can I use sqllite with a mySQL backup file?

开发者 https://www.devze.com 2023-04-03 04:25 出处:网络
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 us开发者_JS百科e the version on the server when online, and use th

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 us开发者_JS百科e 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") 


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消