Ibrahim
Ibrahim

Reputation: 11

Can not connect to mysql database using Django

I'm trying to connect my Django app with MySQL and I have Successfully installed MySQL-connector-python-2.0.4 also. But after that whenever I run server same error message is showing.

Here are my cmd ...

error error code

Here is the full message showing

Upvotes: 0

Views: 217

Answers (1)

cizario
cizario

Reputation: 4254

you are installing MySQL connector for python (not recommended), you need the MySQLdb module, refer to this official recommendation from django doc https://docs.djangoproject.com/en/3.0/ref/databases/#mysql-db-api-drivers and install mysqlclient it is a native driver and It’s the recommended choice.

pip install mysqlclient

for further informations have a look at this medium post : https://medium.com/@omaraamir19966/connect-django-with-mysql-database-f946d0f6f9e3

Upvotes: 1

Related Questions