Connect to MySQL
- Install mysql dependencies and the connector
$ pip3 install mysqlclient(Error: mysql_config not found)
mysql-config is in a different package, which can be installed
$ sudo apt-get install libmysqlclient-dev
- Configure the setting
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'DB_NAME',
'USER': 'DB_USER',
'PASSWORD': 'DB_PASSWORD',
'HOST': 'localhost', # Or an IP Address that your DB is hosted on
'PORT': '3306',
}
}
You would enable the environment variables setting in the system.