Django

Code

Ticket #5024 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

"Passwd" is invalid option in MySQL option file; must use "Password"

Reported by: ispivey@gmail.com Assigned to: nobody
Milestone: Component: Documentation
Version: SVN Keywords: mysql database sprintsept14
Cc: sander.dijkhuis@gmail.com Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

I followed the instructions in the tutorial and at http://www.djangoproject.com/documentation/databases/ for configuring MySQL to work with Django using an option file. When trying to start the server with 'python manage.py runserver', the server threw an exception. The root exception was:

_mysql_exceptions.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")

When I changed the password line in my option file from "passwd = XXX" to "password = XXX", the error disappeared and I was able to start the server. This was strange, because when running the mysql client from the shell I can use either option "passwd" or "password" to login. I've pasted the config files below with the passwords blanked out. Software versions below config files.

#settings.py
...
DATABASE_ENGINE = 'mysql'
DATABASE_OPTIONS = {
                "init_command": "SET storage_engine=INNODB",
                'read_default_file': '/home/ispivey/Code/django/mysql.cnf'
                }
...
#mysql.cnf
[client]
database = testdb
user = root
passwd = XXXXX
default-character-set = utf8

Using:
django trunk from svn on Jul 31st
Ubuntu Feisty Fawn
mysql-server 5.0.38-0
mysqldb 1.2.1-p2-4

Attachments

5024.diff (425 bytes) - added by ubernostrum on 09/14/07 18:52:47.
Patch changing 'passwd' to 'password'

Change History

08/06/07 00:26:42 changed by adrian

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

This smells like the problem is in another place -- i.e., changing "passwd" to "password" just coincidentally fixed it. I would be a lot more confident in this if you could figure out *why* that was happening.

08/10/07 16:51:23 changed by sander.dijkhuis@gmail.com

I've got the same configuration as the reporter, and this fix worked for me. Also in the default /etc/mysql/debian.cnf, 'password' is used instead of 'passwd'. Maybe this is a new standard in MySQL 5.0 or in Ubuntu's configuration?

08/10/07 16:52:06 changed by sander.dijkhuis@gmail.com

  • cc set to sander.dijkhuis@gmail.com.

08/10/07 22:22:18 changed by Simon G. <dev@simon.net.nz>

I've been digging through the mysql docs, and all the examples for for versions 4.1, 5.0 and 5.1 are using password instead of passwd.

Has anyone used passwd=xxx successfully?

09/14/07 18:52:47 changed by ubernostrum

  • attachment 5024.diff added.

Patch changing 'passwd' to 'password'

09/14/07 18:54:33 changed by ubernostrum

  • keywords changed from mysql database to mysql database sprintsept14.
  • has_patch set to 1.
  • stage changed from Unreviewed to Ready for checkin.

Attached patch which brings our example into conformance with MySQL's docs, bumping to "ready for checkin".

09/15/07 00:00:21 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [6261]) Fixed #5024 -- Fixed potential error in docs/databases.txt related to MySQL 'passwd'. Thanks, ispivey@gmail.com and ubernostrum


Add/Change #5024 ("Passwd" is invalid option in MySQL option file; must use "Password")




Change Properties
Action