This is the settings.py file for python. I set mysql up via macports (mysql5 & mysqldb) The problem is that I am unsure if I have the configuration correct before I sync the db. The user name to connect mysql is different than the user with privileges on the db but the password is the same on both the connect & user with privileges. Which user name should go in the settings.py file? Port should be left blank, I believe the default is 3306. I hope that's correct? thanks....

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql' 'NAME': 'jenniwren' # Or path to database file if using sqlite3. 'USER': '*****' # Not used with sqlite3. 'PASSWORD': '*******' # Not used with sqlite3. 'HOST': '/var/run/mysql5/mysqld.sock' # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } }

1 Answer 1


The username should be the MySQL user with rights to the database. When you're logged on as that user, and enter:


into the console, you should see a reference to the database name jenniwren. As root, you can also do:

select Db, User from mysql.db where Db = 'jenniwren';

That will show which user(s) have privileges on that database.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.