操作系统: CentOS 6.4 python版本3.4 django版本1.8
我研究过django框架。然后,我将移动到存储部分。在研究之初,默认数据库是sqlite。所以我更改了settings.py文件中的一些值。
#DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
#}
DATABASES = {
'default' : {
'ENGINE' : 'mysql.connector.django',
'NAME' : 'dj_mysql',
'USER' : 'root',
'PASSWORD' : '',
'HOST' : '127.0.0.1',
'PORT' :''
}
}我输入了"python3 manage.my migrate",我得到了这些错误。
我怎样才能克服这种情况。我整天都在挣扎。

发布于 2015-07-15 23:05:07
看起来你正在尝试使用MySQL连接器。Django文档建议使用doesn't always support the latest version of Django。This bug report建议2.1.3支持Django 1.8,但用户仍然在该错误报告和this question中报告了2.1.3的问题。
通过Django使用mysqlclient访问MySQL数据库的Django docs recommend。
它很容易安装,例如使用pip:
pip install mysqlclient然后,您需要做的就是将数据库设置更改为
DATABASES = {
'default' : {
'ENGINE' : 'django.db.backends.mysql',
...发布于 2015-10-29 15:20:03
您应该更新mysql-connector-python,因为旧版本不能很好地支持Django 1.8。正如Django的文档所说:
可以从下载页面获得
MySQL连接器/Python。Django >适配器在1.1.X和更高版本中可用。它可能不支持>最新版本的Django。
使用以下命令从MySQL网站对其进行更新:
pip install http://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-2.1.3.tar.gzhttps://stackoverflow.com/questions/31433762
复制相似问题