[Django] #31491: "dbshell" command for MySql back-end uses "passwd" instead of "password"

8 views
Skip to first unread message

Django

unread,
Apr 21, 2020, 2:20:02 AM4/21/20
to django-...@googlegroups.com
#31491: "dbshell" command for MySql back-end uses "passwd" instead of "password"
-------------------------------------+-------------------------------------
Reporter: NeoXtreme | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: 3.0
(Management commands) | Keywords: dbshell, db,
Severity: Normal | command-line
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.
I shall create a pull request in a while.
(My apologies for any mistake, I am new to bug-tracking system)

--
Ticket URL: <https://code.djangoproject.com/ticket/31491>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 21, 2020, 2:20:59 AM4/21/20
to django-...@googlegroups.com
#31491: "dbshell" command for MySql back-end uses "passwd" instead of "password"
-------------------------------------+-------------------------------------
Reporter: NeoXtreme | Owner: NeoXtreme
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.0
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage:
command-line | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by NeoXtreme):

* owner: nobody => NeoXtreme
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:1>

Django

unread,
Apr 21, 2020, 2:27:36 AM4/21/20
to django-...@googlegroups.com
#31491: "dbshell" command for MySql back-end uses "passwd" instead of "password"
-------------------------------------+-------------------------------------
Reporter: NeoXtreme | Owner: NeoXtreme
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.0
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage:
command-line | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by NeoXtreme:

Old description:

> 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.
> I shall create a pull request in a while.
> (My apologies for any mistake, I am new to bug-tracking system)

New description:

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.

I shall create a pull request f the ticket is accepted.


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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:2>

Django

unread,
Apr 21, 2020, 2:46:47 AM4/21/20
to django-...@googlegroups.com
#31491: "dbshell" command for MySql back-end uses "passwd" instead of "password"
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
| Sharma

Type: Bug | Status: assigned
Component: Core (Management | Version: 3.0
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage:
command-line | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Maruti N Sharma):

* Attachment "ticket_31491.diff" added.

patch file

Django

unread,
Apr 21, 2020, 2:47:14 AM4/21/20
to django-...@googlegroups.com
#31491: "dbshell" command for MySql back-end uses "passwd" instead of "password"
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
| Sharma
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.0
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage:
command-line | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Maruti N Sharma):

* has_patch: 0 => 1


Old description:

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

> I shall create a pull request f the ticket is accepted.

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

New description:

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.

I shall create a pull request f the ticket is accepted.

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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:3>

Django

unread,
Apr 21, 2020, 2:53:33 AM4/21/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".

-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
Type: | Sharma
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* type: Bug => Cleanup/optimization
* version: 3.0 => master
* easy: 0 => 1
* stage: Unreviewed => Accepted


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:4>

Django

unread,
Apr 21, 2020, 4:29:45 AM4/21/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
Type: | Sharma
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Maruti N Sharma:

Old description:

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

> I shall create a pull request f the ticket is accepted.

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

New description:

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)

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:5>

Django

unread,
Apr 21, 2020, 4:33:37 AM4/21/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
Type: | Sharma
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Maruti N Sharma):

Replying to [comment:4 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, but it should not attempt to get the "passwd" from
settings_dict instead of "password", which would cause connection failure
if there is no "passwd" key specified in django db settings (only
"password" key) .
I apologise if description wasn't clear enough. I will add reproduction
steps.

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:6>

Django

unread,
Apr 21, 2020, 4:42:57 AM4/21/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
Type: | Sharma
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Old description:

> 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)

New description:

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]

steps to reproduce:
---------------------------------
- create a new django project, set env
- choose mysql as db back-end
- specify db setting as following (ref:
[https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-
DATABASES])

{{{
# use actual db username, password etc
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mydatabase',
'USER': 'mydatabaseuser',
'PASSWORD': 'mypassword',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
}}}

- Open a terminal and activate respective environment
- run: ''python manage.py dbshell''
- You should get following error: **Access denied for user
'mydatabaseuser'@'localhost' (using password: NO)**

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

--

Comment (by Maruti N Sharma):

Added steps to reproduce.

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:7>

Django

unread,
Apr 21, 2020, 4:45:00 AM4/21/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
Type: | Sharma
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Maruti N Sharma:

Old description:

> 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]
>
> steps to reproduce:
> ---------------------------------
> - create a new django project, set env
> - choose mysql as db back-end
> - specify db setting as following (ref:
> [https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-
> DATABASES])
>
> {{{
> # use actual db username, password etc
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'mydatabase',
> 'USER': 'mydatabaseuser',
> 'PASSWORD': 'mypassword',
> 'HOST': '127.0.0.1',
> 'PORT': '5432',
> }
> }
> }}}
>
> - Open a terminal and activate respective environment
> - run: ''python manage.py dbshell''
> - You should get following error: **Access denied for user
> 'mydatabaseuser'@'localhost' (using password: NO)**
>

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

New description:

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]\\
\\
\\


**Steps to reproduce:**

- create a new django project, set env
- choose mysql as db back-end
- specify db setting as following (ref:
[https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-
DATABASES])

{{{
# use actual db username, password etc
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mydatabase',
'USER': 'mydatabaseuser',
'PASSWORD': 'mypassword',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
}}}

- Open a terminal and activate respective environment
- run: ''python manage.py dbshell''
- You should get following error: **Access denied for user
'mydatabaseuser'@'localhost' (using password: NO)**

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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:8>

Django

unread,
Apr 21, 2020, 4:50:27 AM4/21/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
Type: | Sharma
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Maruti N Sharma:

Old description:

> 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]\\
> \\
> \\
>

> **Steps to reproduce:**
>
> - create a new django project, set env
> - choose mysql as db back-end
> - specify db setting as following (ref:
> [https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-
> DATABASES])
>
> {{{
> # use actual db username, password etc
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'mydatabase',
> 'USER': 'mydatabaseuser',
> 'PASSWORD': 'mypassword',
> 'HOST': '127.0.0.1',
> 'PORT': '5432',
> }
> }
> }}}
>
> - Open a terminal and activate respective environment
> - run: ''python manage.py dbshell''
> - You should get following error: **Access denied for user
> 'mydatabaseuser'@'localhost' (using password: NO)**
>

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

New description:

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)

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:9>

Django

unread,
Apr 21, 2020, 4:52:39 AM4/21/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
Type: | Sharma
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:10>

Django

unread,
Apr 21, 2020, 4:53:17 AM4/21/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
Type: | Sharma
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Maruti N Sharma):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:11>

Django

unread,
Apr 21, 2020, 5:15:43 AM4/21/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Maruti N
Type: | Sharma
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:12>

Django

unread,
Jun 11, 2020, 4:36:22 PM6/11/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Hasan
Type: | Ramezani

Cleanup/optimization | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* owner: Maruti N Sharma => Hasan Ramezani
* needs_better_patch: 1 => 0


Comment:

[https://github.com/django/django/pull/13050 New PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:13>

Django

unread,
Jun 12, 2020, 6:08:35 AM6/12/20
to django-...@googlegroups.com
#31491: dbshell command for MySQL backend uses "passwd" instead of "password".
-------------------------------------+-------------------------------------
Reporter: Maruti N Sharma | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution: fixed

Keywords: dbshell, db, | Triage Stage: Accepted
command-line |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"9e8edc1e5511f128dec6bcd70a10ebd263b76280" 9e8edc1]:
{{{
#!CommitTicketReference repository=""
revision="9e8edc1e5511f128dec6bcd70a10ebd263b76280"
Fixed #31491 -- Allowed 'password' option in DATABASES['OPTIONS'] on
MySQL.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31491#comment:14>

Reply all
Reply to author
Forward
0 new messages