Opened 5 years ago

Closed 4 years ago

#31491 closed Cleanup/optimization (fixed)

dbshell command for MySQL backend uses "passwd" instead of "password".

Reported by: Maruti N Sharma Owned by: Hasan Ramezani
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: dbshell, db, command-line
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Maruti N Sharma)

For MySql, "passwd" has been replaced with "password" long time ago, please check here https://code.djangoproject.com/ticket/5024
But dbshell command still looks for "passwd" key in the settings for db password, resulting in connection error.
This behaviour is also slightly different than other back-ends.

Pull request submitted: https://github.com/django/django/pull/12763

(My apologies for any mistake, I am new to bug-tracking system)

Attachments (1)

ticket_31491.diff (863 bytes ) - added by Maruti N Sharma 5 years ago.
patch file

Download all attachments as: .zip

Change History (15)

comment:1 by Maruti N Sharma, 5 years ago

Owner: changed from nobody to Maruti N Sharma
Status: newassigned

comment:2 by Maruti N Sharma, 5 years ago

Description: modified (diff)

by Maruti N Sharma, 5 years ago

Attachment: ticket_31491.diff added

patch file

comment:3 by Maruti N Sharma, 5 years ago

Description: modified (diff)
Has patch: set

comment:4 by Mariusz Felisiak, 5 years ago

Easy pickings: set
Summary: "dbshell" command for MySql back-end uses "passwd" instead of "password"dbshell command for MySQL backend uses "passwd" instead of "password".
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization
Version: 3.0master

passwd from OPTIONS is passed to a --password argument so it shouldn't cause any connection failures. However I agree that we can unify this. We can add a small release note (even if it's not documented). Please send patch via GitHub.

comment:5 by Maruti N Sharma, 5 years ago

Description: modified (diff)

in reply to:  4 comment:6 by Maruti N Sharma, 5 years ago

Replying to felixxm:

passwd from OPTIONS is passed to a --password argument so it shouldn't cause any connection failures. However I agree that we can unify this. We can add a small release note (even if it's not documented). Please send patch via GitHub.

I understand that, actually I was using "OPTIONS" field for database settings, that is where this caused issue on my end.

If you wish to unify this behaviour, I have submitted the pull request.

Last edited 5 years ago by Maruti N Sharma (previous) (diff)

comment:7 by Maruti N Sharma, 5 years ago

Description: modified (diff)
Last edited 5 years ago by Maruti N Sharma (previous) (diff)

comment:8 by Maruti N Sharma, 5 years ago

Description: modified (diff)

comment:9 by Maruti N Sharma, 5 years ago

Description: modified (diff)

comment:10 by Mariusz Felisiak, 5 years ago

Maruti, steps are incorrect. Django looks for passwd in OPTIONS and for PASSWORD in DATABASES['alias'], if not provided. All works properly.

comment:11 by Maruti N Sharma, 5 years ago

Of course, my mistake, I have updated my comment and the description as well. Thank you.

comment:12 by Mariusz Felisiak, 5 years ago

Patch needs improvement: set

comment:13 by Hasan Ramezani, 4 years ago

Owner: changed from Maruti N Sharma to Hasan Ramezani
Patch needs improvement: unset

comment:14 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 9e8edc1:

Fixed #31491 -- Allowed 'password' option in DATABASESOPTIONS on MySQL.

Note: See TracTickets for help on using tickets.
Back to Top