搭建Django2.0+Python3+MySQL8时同步数据库时报错:
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
解决办法一:
找到Python安装路劲下的Python37\Lib\site-packages\django\db\backends\mysql\base.py文件
将文件中的如下代码注释
if version < (1, 3, 3):
raise ImproperlyConfigured(“mysqlclient 1.3.3 or newer is required; you have %s” % Database.version)
解决办法二:
更换mysql驱动,使用mysqlclient驱动
pip install mysqlclient
在///init.py里将
import pymysql
pymysql.install_as_MySQLdb()
替换成
import MySQLdb
完美解决