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()