将Django DB从SQLite迁移到MySQL的最好方法是什么? [英] What's the best way to migrate a Django DB from SQLite to MySQL?
本文介绍了将Django DB从SQLite迁移到MySQL的最好方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将我的数据库从sqlite迁移到mysql,以及各种工具/脚本有太多,我很容易找到最安全和最优雅的解决方案。
I need to migrate my db from sqlite to mysql, and the various tools/scripts out there are too many for me to easily spot the safest and most elegant solution.
这对我来说很好 http://djangosnippets.org/snippets/14/ ,但出现在从获得更新,这是令人担忧的3年。
This seemed to me nice http://djangosnippets.org/snippets/14/ but appears to be 3 years since getting an update which is worrying..
你可以推荐一个已知是Django 1.1.1可靠的解决方案吗?
Can you recommend a solution that is known to be reliable with Django 1.1.1 ?
推荐答案
执行:
python manage.py dumpdata > datadump.json
接下来,将您的settings.py更改为mysql数据库。
Next, change your settings.py to the mysql database.
最后:
python manage.py loaddata datadump.json
这篇关于将Django DB从SQLite迁移到MySQL的最好方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文