django连接mysql出现问题

出现:django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 1.3.10

参考:

http://blog.sina.com.cn/s/blog_77b3c7c30102vq96.html
https://blog.csdn.net/feilzhang/article/details/80787748
https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
https://www.cnblogs.com/imyalost/p/8542181.html
https://blog.csdn.net/qq_35304570/article/details/79674449
https://stackoverflow.com/Questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found 重点

安装:pip install mysqlclient==1.3.13即可,若出现mysql-config不见,则
sudo apt-get install libmysqlclient-dev 即可解决

然后:

python manage.py makemigrations
python manage.py migrate

2019.4.18

发表评论

电子邮件地址不会被公开。 必填项已用*标注