by Umar Qureshi
To connect MySQL as a database in our Django Project we need to install MYSQLCLIENT
Download the file from the above provided link or go to Click Here
Open the path in your command prompt where you have downloaded the file
Run pip install mysqlclient-1.4.6-cp38-cp38-win32.whl
Note : if you are using virtual environment so install it
under your virtual environment
Check how to setup
virtual environment in python
If you are using XAMPP Server start the Apache Server and MySQL
Note down the port number on which Mysql Server is running. In my case it's 3306
Go to your Django Project's settings.py file
Create a Database in your MySQL
In the Databases change your database configuration to this :
Run "python manage.py makemigrations"
Run "python manage.py migrate"
You can
see your tables getting migrated to your database
Thus by following these steps we can Connect our Django
Project to MySQL using MYSQLCLIENT. If any queries you can get back to
dqureshiumar@gmail.com.
Hope you liked it.
Thank You.