How to connect mysql with django

187 views
Skip to first unread message

Ansh Srivastava

unread,
Nov 11, 2018, 6:57:11 AM11/11/18
to django...@googlegroups.com

I m tryin' to connect mysql database with django, for that, I did this:-

  python manage.py runserver

but, this new mess came around sayin' :-

 (django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
 Did you install mysqlclient?).

But when I m tryin' to install mysqlclient through pip as:-

  pip install mysqlclient

another creepy thing comes up:-

  _mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No 
   such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual 
  Studio\\2017\\Comm
  unity\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed 
  with exit status 2

For installing mysql.h, I have downloaded mysql connector too, but the error continues. I don't know how to proceed furher. Any help would be appreciated.



Mailtrack Sender notified by
Mailtrack 11/11/18, 5:26:30 PM

pujiarahman

unread,
Nov 11, 2018, 10:16:40 AM11/11/18
to Django users
Hi, 

Go to this site  https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
i use this for my python 3.7 and windows x64  : mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
try :  pip install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl

regards

Ansh Srivastava

unread,
Nov 11, 2018, 11:58:00 AM11/11/18
to django...@googlegroups.com
Thank you @pujiarahman. I have tried out the above command but it didn't work!

It says::C:\Users\ansh\Desktop\Dje\p1\marvellous> pip install mysqlclient-1.3.13-cp37-cp3

7m-win_amd64.whl

Requirement 'mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl' looks like a filename,

 but the file does not exist

mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl is not a supported wheel on this pla

tform.

Furthermore appreciated.


Mailtrack Sender notified by
Mailtrack 11/11/18, 10:26:27 PM

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/396993f8-9e9d-4e4e-ac6f-0e687576627d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff Williams

unread,
Nov 11, 2018, 1:14:14 PM11/11/18
to django...@googlegroups.com
Did you download the .whl file first?

Ansh Srivastava

unread,
Nov 11, 2018, 2:27:56 PM11/11/18
to django...@googlegroups.com
Yes @,Jeff Williams , I did but it still prompts the same:

C:\Users\ansh>pip install mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl
Requirement 'mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl' looks like a filename,
 but the file does not exist
mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl is not a supported wheel on this pla
tform.


For more options, visit https://groups.google.com/d/optout.


Mailtrack Sender notified by
Mailtrack 11/12/18, 12:56:16 AM

Jeff Williams

unread,
Nov 11, 2018, 2:37:37 PM11/11/18
to django...@googlegroups.com
give it the full path to the file.  I had the same issue yesterday and this fixed it for me. 

Ansh Srivastava

unread,
Nov 11, 2018, 2:58:59 PM11/11/18
to django...@googlegroups.com
Full path means? If you can send the screenshot or command instead @Jeff Williams


Mailtrack Sender notified by
Mailtrack 11/12/18, 1:28:00 AM

Jeff Williams

unread,
Nov 11, 2018, 3:42:01 PM11/11/18
to django...@googlegroups.com
sorry.  I meant the full path to the file.....like below if you downloaded it into C:\downloads.

pip install c:\downloads\mysqlclient-1.3.13-cp37-cp3


Ansh Srivastava

unread,
Nov 11, 2018, 4:28:28 PM11/11/18
to django...@googlegroups.com
Ahhh! not working: 
C:\Users\ansh>pip install c:\downloads\mysqlclient-1.3.13-cp37-cp3
Invalid requirement: 'c:\downloads\mysqlclient-1.3.13-cp37-cp3'
It looks like a path. File 'c:\downloads\mysqlclient-1.3.13-cp37-cp3' does not e
xist.
I just simply pasted your command !

Mailtrack Sender notified by
Mailtrack 11/12/18, 2:57:02 AM

Jeff Williams

unread,
Nov 11, 2018, 4:53:01 PM11/11/18
to django...@googlegroups.com
You have to use the path of where you! downloaded the file.
Reply all
Reply to author
Forward
0 new messages