首页 > 数据库技术 > 详细

Django2.2连接MySQL问题解决

时间:2019-11-01 10:16:16      阅读:147      评论:0      收藏:0      [点我收藏+]

报错一:

django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

解决方法:编辑文件,注释掉如下行:

version = Database.version_info
# if version < (1, 3, 13):
#     raise ImproperlyConfigured(‘mysqlclient 1.3.13 or newer is required; you have %s.‘ % Database.__version__)

 

报错二:

File "D:\data\gitee.com\ExamOnline\venv\lib\site-packages\django\db\backends\mysql\operations.py", line 146, in last_executed_query query = query.decode(errors=‘replace‘) AttributeError: ‘str‘ object has no attribute ‘decode‘

解决方法:

编辑文件operations.py,注释掉如下行

query = getattr(cursor, _executed, None)
# if query is not None:
# query = query.decode(errors=‘replace‘)
return query

 

Django2.2连接MySQL问题解决

原文:https://www.cnblogs.com/miaocbin/p/11775107.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!