summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/client.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-06-11 20:12:35 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-06-12 12:07:43 +0200
commit9e8edc1e5511f128dec6bcd70a10ebd263b76280 (patch)
tree7e8b5d42b733f1372330a49292aefeca43012282 /django/db/backends/mysql/client.py
parent2928019e0ccd8e9c7d3a3fba7722a7af87018e5d (diff)
downloaddjango-9e8edc1e5511f128dec6bcd70a10ebd263b76280.tar.gz
Fixed #31491 -- Allowed 'password' option in DATABASES['OPTIONS'] on MySQL.
Diffstat (limited to 'django/db/backends/mysql/client.py')
-rw-r--r--django/db/backends/mysql/client.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/django/db/backends/mysql/client.py b/django/db/backends/mysql/client.py
index e5b6a59fb2..904c450cef 100644
--- a/django/db/backends/mysql/client.py
+++ b/django/db/backends/mysql/client.py
@@ -11,7 +11,10 @@ class DatabaseClient(BaseDatabaseClient):
args = [cls.executable_name]
db = settings_dict['OPTIONS'].get('db', settings_dict['NAME'])
user = settings_dict['OPTIONS'].get('user', settings_dict['USER'])
- passwd = settings_dict['OPTIONS'].get('passwd', settings_dict['PASSWORD'])
+ password = settings_dict['OPTIONS'].get(
+ 'password',
+ settings_dict['OPTIONS'].get('passwd', settings_dict['PASSWORD'])
+ )
host = settings_dict['OPTIONS'].get('host', settings_dict['HOST'])
port = settings_dict['OPTIONS'].get('port', settings_dict['PORT'])
server_ca = settings_dict['OPTIONS'].get('ssl', {}).get('ca')
@@ -24,8 +27,8 @@ class DatabaseClient(BaseDatabaseClient):
args += ["--defaults-file=%s" % defaults_file]
if user:
args += ["--user=%s" % user]
- if passwd:
- args += ["--password=%s" % passwd]
+ if password:
+ args += ["--password=%s" % password]
if host:
if '/' in host:
args += ["--socket=%s" % host]