我想开始在现有的MySQL数据库中使用iPhone上的核心数据。将MySQL数据库转移到SQLite最简单的方法是什么?
我试过使用ODBC Migrator,但我不知道在哪里可以找到SQLite驱动程序(雪豹)。我找到了http://www.ch-werner.de/sqliteodbc/,它似乎有驱动程序,但它们是用于Power PC的。
如果有人能给我介绍一下,或者告诉我最好的工具是什么,我将不胜感激。
谢谢。
发布于 2012-12-04 18:08:45
为了进行转换,我最终使用了ODBC from Actual Access。我想我把它和SQLite Migrator结合使用了。我从来不喜欢这种方式,尽管它总是很笨拙。价格也很昂贵,这两款软件最终的成本约为80美元。
如果让我再做一次,我会买SQLabs的SQLiteConverter。我使用他们的SQLite管理器,虽然它有很多接口问题,但对于数据库软件来说还不错。
发布于 2009-11-06 06:45:29
也许最简单的方法是使用mysqldump将MySQL数据库中的原始SQL转储到一个文本文件中,然后使用sqlite3_exec()函数执行该SQL以填充SQLite数据库。
发布于 2009-11-03 13:02:00
你看过this Perl script吗?我还没有用过它--我只是快速搜索了一下mysql到sqlite的迁移,然后它就弹出来了。
编辑(在你回复我的评论后):
reverse direction is dealt with here。
如果你要重复这样做,如果数据结构发生了变化,也许你最好使用像Django这样的东西(尽管是以一种非常黑客的方式)。有了它,我会:
# This three lines are done once
django-admin.py startproject mymigrationproject
cd mymigrationproject
./manage.py startapp migration
# The following lines you repeat each time you want to migrate the data
edit settings.py and make the changes to connect to MySQL
./manage.py inspectdb > ./migration/models.py
edit ./migration/models.py to reorder tables (tables in which other tables depend on top)
mkdir fixtures
./manage.py dumpdata migration > ./fixtures/data.json
edit settings.py and make the changes to connect to SQLite
./manage.py syncdb
./manage.py loaddata ./fixtures.data.jsonhttps://stackoverflow.com/questions/1665061
复制相似问题