【发布时间】:2019-12-25 16:48:37
【问题描述】:
运行命令时:python manage.py runserver 我收到以下错误:
django.db.utils.OperationalError: (2059, "Authentication plugin 'caching_sha2_password' cannot be loaded: The specified module could not be found.\r\n")
这些是相关设置:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'polls',
'USER': 'root',
'PASSWORD': '<my-password>',
'HOST': 'localhost'
}
}
我已经看到了解决该问题的解决方案,例如 this thread。他们建议将引擎更改为mysql.connector.django,但是django推荐的引擎是mysqlclient,因此我想使用它。
其他建议是use naive password instead of sha2。出于安全原因,我宁愿不采用此解决方案。
版本:
- mysql 8.0.17 for Win64 on x86_64(MySQL 社区服务器 - GPL)
- python 3.7.4
- Django 2.2.4
- mysqlclient 1.4.4
【问题讨论】:
标签: python mysql django python-3.x mysql-connector