[Fixed]-How to use MySQL as DB for a django project?

1👍

You can install mysql db using pip install mysql-python command,if you want specific version of python mysql use pip install mysql-python==1.2.5

https://pypi.python.org/pypi/MySQL-python/1.2.5

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django_api_test', # database name
'USER': 'root', # database username
'PASSWORD': 'admin', # database password
}

}

Do database setting in setting.py file.
Thanks

0👍

You need to install the PyMySQLdb module into your Python environment. Do pip install MySQL-python, and it should install the MySQL bindings in your Python environment.

👤mprat

Leave a comment