1.python3.6报错:AttributeError: 'str' object has no attribute 'decode'python
修改方法:把decode改成encode便可mysql
2. django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11sql
找到Python安装路劲下的Python36-32\Lib\site-packages\django\db\backends\mysql\base.py文件数据库
将文件中的以下代码注释django
if version < (1, 3, 3):
raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is required; you have %s" % Database.__version__)ui
3.Dajango 数据库切换为MYSQL的问题:Error loading MySQLdb module.解决方案code
$ pip install pymysqlip
安装完毕,打开( python目录 :**\Python3.7.3\Lib\site-packages\django\db\backends\mysql)__init__.py,添加代码it
import pymysqlpip
pymysql.install_as_MySQLdb()