1
Hello! Here’s the thing, I’m having a problem connecting to mysql with Django. The error is this:
Django.core.exceptions.Improperlyconfigured: Error loading Mysqldb module. Did you install mysqlclient?
The first solution I found on the internet was to simply install this module with Pip install mysqlclient. Without success, I was returned a giant mistake.
running build_ext building 'Mysqldb. _mysql' Extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
I tried to install "Microsoft Visual C++ Build Tools", unsuccessful.
The second solution I found was to add the following lines inside the file Settings.py, soon after installing pymysql with Pip.
import pymysql
pymysql.install_as_MySQLdb()
This returned me the following error:
Django.core.exceptions.Improperlyconfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
I have no idea what it can be or what to do, since I’m a beginner and I don’t have much sense :/
Does anyone have any idea what it might be? Thank you and await reply!
You can run everything with Docker, if you are willing I can show a working setup. This error there has face of being problem with the version of you and the SO, the last message there says that you are with an old version of
mysqlclient
, tries to put the younger one– Ricardo