Last Updated: February 25, 2016
·
1.088K
· gungorbudak

How to Set Up a MySQL Database for a Mezzanine Project

Here I describe how you use a MySQL database in your Mezzanine project. It's simple installation, database creation, and settings configuration steps.

I previously posted this on my Tumblr blog: http://gungorbudak.tumblr.com/post/118513377647/how-to-set-up-a-mysql-database-for-a-mezzanine

Steps

Install mysql-server and python-mysqldb package:

$ sudo apt-get install mysql-server
$ sudo apt-get python-mysqldb

Run MySQL:

$ mysql -u root -p

Create a DB:

mysql> create database mezzanine_project;

Confirm by looking at available databases and exit:

mysql> show databases;
mysql> exit

Configure local_settings.py:

cd path/to/your/mezzanine/project
nano local_settings.py

Complete DATABASES dictionary:

DATABASES = {
   "default": {
       "ENGINE": “django.db.backends.mysql”,
       "NAME": “mezzanine_project”,
       "USER": “root”,
       "PASSWORD": “123456”,
       "HOST": “”,
       "PORT": “”,
   }
}