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": “”,
}
}
Written by Gungor Budak
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#