#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 <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.eb164f807cb5427e30e0bdacca10d4a5%40djangoproject.com.

Reply via email to