Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Settings in django
How to install mysql-client to connect django and MySQL:
(1). Make sure the MySQL is installed
(2). Use the following command to install the package:
$sudo apt-get install libmysqlclient-dev
$ sudo apt-get install mysql-devel
(3). inside the virtualenv
$ pip3 install mysqlclient
(4). The database connection parameters setting
'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': 'localhost', # Or an IP Address that your DB is hosted on
'PORT': '3306',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment