【发布时间】:2018-12-25 03:52:13
【问题描述】:
这是我在 django settings.py 中用于数据库的代码:
DATABASES= {
'defualt': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'cameronkc',
'USER': 'root',
'PASSWORD': '123456',
'HOST': 'localhost',
'PORT': ''
}
}
这是我在命令提示符下执行 >python manage.py migrate 时收到的错误
django.db.utils.ConnectionDoesNotExist: The connection default doesn't exist
【问题讨论】:
-
尝试添加 'PORT': 3306 并重试。 3306 是 mysql 的默认端口。而且您知道您的用户、密码和“名称”数据库是正确的吗?
标签: python mysql django database connection