Menu

Django and MySQL

February 27, 2017 - django, python

MySQL Client

mysqlclient

Download the source and untar

python3 setup.py build
sudo python setup.py install

Turn on mySQL server

Connect with Django

settings.py DATABASES

'ENGINE': 'django.db.backends.mysql',
'NAME': 'dbname',
'USER':'root',
'PASSWORD': 'xxxx',
'HOST': 'localhost',
'PORT': '3306',

Run migrate command

In project folder:

python3 manage.py migrate

As a reference
https://github.com/PyMySQL/PyMySQL

Tags: ,