Opened 5 months ago

Closed 4 months 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: master
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 months ago.
patch file

Download all attachments as: .zip

Change History (15)

comment:1 Changed 5 months ago by Maruti N Sharma

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

comment:2 Changed 5 months ago by Maruti N Sharma

Description: modified (diff)

Changed 5 months ago by Maruti N Sharma

Attachment: ticket_31491.diff added

patch file

comment:3 Changed 5 months ago by Maruti N Sharma

Description: modified (diff)
Has patch: set

comment:4 Changed 5 months ago by felixxm

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 Changed 5 months ago by Maruti N Sharma

Description: modified (diff)

comment:6 in reply to:  4 Changed 5 months ago by Maruti N Sharma

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 months ago by Maruti N Sharma (previous) (diff)

comment:7 Changed 5 months ago by Maruti N Sharma

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

comment:8 Changed 5 months ago by Maruti N Sharma

Description: modified (diff)

comment:9 Changed 5 months ago by Maruti N Sharma

Description: modified (diff)

comment:10 Changed 5 months ago by felixxm

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

comment:11 Changed 5 months ago by Maruti N Sharma

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

comment:12 Changed 5 months ago by felixxm

Patch needs improvement: set

comment:13 Changed 4 months ago by Hasan Ramezani

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

comment:14 Changed 4 months ago by Mariusz Felisiak <felisiak.mariusz@…>

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