Mysql Setup

Download mysql connector for windows and install

open cmd

setx mysql_config "C:\path\to\mysql_config"

then

pip install mysqlclient

if face any problem try

pip install mysqlclient --global-option=build_ext --global-option="-I/path/to/mysql/include"

open project settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'your_database_name',
        'USER': 'your_mysql_username',
        'PASSWORD': 'your_mysql_password',
        'HOST': 'localhost',  # Or the MySQL server's hostname
        'PORT': '3306',       # Or the port MySQL is listening on
    }
}

Last updated