[Django] #32732: MySQL Client Uses Deprecated "db" and "passwd" kwargs

46 views
Skip to first unread message

Django

unread,
May 9, 2021, 7:15:58 PM5/9/21
to django-...@googlegroups.com
#32732: MySQL Client Uses Deprecated "db" and "passwd" kwargs
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
gopackgo90 |
Type: | Status: new
Uncategorized |
Component: Database | Version: dev
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The "db" and "passwd" usage can be seen at
https://github.com/django/django/blob/ca9872905559026af82000e46cde6f7dedc897b6/django/db/backends/mysql/base.py#L202-L205
in main. mysqlclient recently marked these two kwargs as deprecated (see
https://github.com/PyMySQL/mysqlclient/commit/fa25358d0f171bd8a63729c5a8d76528f4ae74e9)
in favor of "database" and "password" respectively. mysqlclient added
support for "database" and "password" in 1.3.8 with
https://github.com/PyMySQL/mysqlclient/commit/66029d64060fca03f3d0b22661b1b4cf9849ef03.

Django 2.2, 3.1, and 3.2 all require a minimum version of mysqlclient
newer than 1.3.8, so a fix for this could be backported to all currently
supported versions of Django.

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

Django

unread,
May 10, 2021, 12:33:24 AM5/10/21
to django-...@googlegroups.com
#32732: MySQL backend uses deprecated "db" and "passwd" kwargs.
-------------------------------------+-------------------------------------
Reporter: gopackgo90 | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

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

* version: dev => 3.2
* easy: 0 => 1
* keywords: => mysql
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

Thanks for this report.

> Django 2.2, 3.1, and 3.2 all require a minimum version of mysqlclient
newer than 1.3.8, so a fix for this could be backported to all currently
supported versions of Django.

Django 2.2 and 3.1 are in extended support so they don't receive bugfixes
anymore (except security patches). We'll document the maximum supported
version of `mysqlclient` in these versions as soon as deprecated kwargs
are removed.

IMO we can backport this to the Django 3.2 since it's LTS.

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

Django

unread,
May 10, 2021, 4:43:01 PM5/10/21
to django-...@googlegroups.com
#32732: MySQL backend uses deprecated "db" and "passwd" kwargs.
-------------------------------------+-------------------------------------
Reporter: gopackgo90 | Owner: Nick Pope
Type: | Status: assigned

Cleanup/optimization |
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* owner: nobody => Nick Pope
* status: new => assigned
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/14376 PR]

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

Django

unread,
May 12, 2021, 3:53:13 AM5/12/21
to django-...@googlegroups.com
#32732: MySQL backend uses deprecated "db" and "passwd" kwargs.
-------------------------------------+-------------------------------------
Reporter: gopackgo90 | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


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

Django

unread,
May 12, 2021, 4:55:16 AM5/12/21
to django-...@googlegroups.com
#32732: MySQL backend uses deprecated "db" and "passwd" kwargs.
-------------------------------------+-------------------------------------
Reporter: gopackgo90 | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* needs_better_patch: 1 => 0


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

Django

unread,
May 12, 2021, 7:34:51 AM5/12/21
to django-...@googlegroups.com
#32732: MySQL backend uses deprecated "db" and "passwd" kwargs.
-------------------------------------+-------------------------------------
Reporter: gopackgo90 | Owner: Nick Pope
Type: | Status: closed

Cleanup/optimization |
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: mysql | Triage Stage: Accepted
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:"1061f5243646b4c9b8a758f8a36c9e2ccdded1cf" 1061f52]:
{{{
#!CommitTicketReference repository=""
revision="1061f5243646b4c9b8a758f8a36c9e2ccdded1cf"
Fixed #32732 -- Removed usage of deprecated 'db' and 'passwd' connection
options in MySQL backend.

The 'db' and 'passwd' connection options have been deprecated, use
'database' and 'password' instead (available since mysqlclient >= 1.3.8).

This also allows the 'database' option in DATABASES['OPTIONS'] on MySQL.
}}}

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

Django

unread,
May 12, 2021, 7:35:45 AM5/12/21
to django-...@googlegroups.com
#32732: MySQL backend uses deprecated "db" and "passwd" kwargs.
-------------------------------------+-------------------------------------
Reporter: gopackgo90 | Owner: Nick Pope
Type: | Status: closed
Cleanup/optimization |
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: mysql | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"4318e60a8025371a6da550eecc798e32d3864f9d" 4318e60a]:
{{{
#!CommitTicketReference repository=""
revision="4318e60a8025371a6da550eecc798e32d3864f9d"
[3.2.x] Fixed #32732 -- Removed usage of deprecated 'db' and 'passwd'


connection options in MySQL backend.

The 'db' and 'passwd' connection options have been deprecated, use
'database' and 'password' instead (available since mysqlclient >= 1.3.8).

This also allows the 'database' option in DATABASES['OPTIONS'] on MySQL.

Backport of 1061f5243646b4c9b8a758f8a36c9e2ccdded1cf from main
}}}

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

Reply all
Reply to author
Forward
0 new messages