Skip to content

Instantly share code, notes, and snippets.

@aaronlelevier
Created August 13, 2014 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronlelevier/0577264ca4f12b754c01 to your computer and use it in GitHub Desktop.
Save aaronlelevier/0577264ca4f12b754c01 to your computer and use it in GitHub Desktop.
MySQL Django settings and config
I currently use Postgres and a Mac for my Django Dev environment. However, when I first started I was using a Windows machine with MySQL. When I looked through my notes just now, it was pretty easy to set up. (I didn't use xampp however). What I installed was:
1. MySQL workbench: http://dev.mysql.com/downloads/workbench/
2. MySQL-python connector - I used pip install for this. So if you have "pip" then it's just:
pip install mysql-python
3. And, this is what my database settings looked like in my settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'database_name',
'USER': 'mysql_username,
'PASSWORD': 'mysql_password,
'HOST': '127.0.0.1',
'PORT': '3306',
'OPTIONS': {
'read_default_file': 'my.cnf'
}
}
}
Copy link

ghost commented Aug 13, 2014

Thanks very much Aron.. I will give this a go when I get back home this evening! Hopefully it puts an end to my few days of frustration. :)

Would there be any major differences to running Postgres and Mac? (easier/more difficult etc?). I have windows and mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment