Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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. } }

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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

SHOW GRANTS;

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.

share|improve this answer
    
Matthew thank you that really helps a lot...... –  demet8 Aug 2 '10 at 12:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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