简体   繁体   中英

Connect mysql database with django

I am a begginer in django, i try to connect mysql database with django but when i write python manage.py migrate in cmd i see this error: mysqlclient 1.3.13 or newer is required yo have 0.9.3 so i decide to upgrade mysql client using this command: pip install mysqlclient --upgrade and i get this output: 在此处输入图片说明 在此处输入图片说明 在此处输入图片说明 https://i.stack.imgur.com/bq7Jn.jpg

https://i.stack.imgur.com/nYGSQ.jpg https://i.stack.imgur.com/u8wzN.jpg

How to fix it?

Try to install using wheel

pip install wheel

Download the mysqlclient from

https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python

for python 3.X

pip install mysqlclient-1.3.8-cp36-cp36m-win_amd64.whl

for python 2.x

pip install mysqlclient-1.3.8-cp27-cp27m-win_amd64.whl

如果不安装 Visual Studio 和其他工具,通常会在 Windows 中发生此错误。如果您在 Django + Windows 中工作,则安装 Visual Studio 最新版本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM