0

I am new to Python and Django. Now I would like to connect to mysql from Django and I just run pip install mysqlclient.

First I installed xampp and I just use phpmyadmin to connect MySQL and I created new database and tables

Second I installed Microsoft Builds Tools 2017

But this error is still showing.

So I just download the MySql and I got a zip file. I extracted and mysql.h exist in this folder. I don't know what I have to with this zip file. :(

Third I download the mysql-installer.msi and I installed MySQL and python connection.

but this error still happens.

I am really messing with this database.

So how can I connect to MySql from Django like other people does (They does like this is very easy.).

lwin
  • 3,784
  • 6
  • 25
  • 46

1 Answers1

0

Yes, Python with embedded C source are always tricky to install under Windows. So, either you find a suitable binary (pre-compiled) wheel package for mysqlclient, or you try this instead.

https://pypi.org/project/PyMySQL/

PyMySQL is a pure Python implementation, so does not require the source code of the C client lib.

Ah! Read this too...

How to config Django using pymysql as driver?

glenfant
  • 1,298
  • 8
  • 9