修改/usr/local/lib/python3.5/dist-packages/django/db/backends/mysql/base.py文件,注释掉:
#if version < (1, 3, 13): #raise ImproperlyConfigured(‘mysqlclient 1.3.13 or newer is required; you have %s.‘ % Database.__version__)
检查服务器是否能连接到数据库,是否有什么限制,eg:端口等等
cd /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Django-2.2-py3.7.egg/django/db/backends/mysqlvim operations.py找到错误代码(line146):query = query.encode(errors=‘replace‘)解决方法:把decode改为encode即可。保存并退出。