MT#58395 include db_host and db_port into mysql cmd opts

* config._run_cmd_mysql_options now includes -u db_host
  -P db_port options to match the pymysql connection behaviour

Change-Id: I81955f4382c485acb17e123cfa42e27601171d05
mr12.2
Kirill Solomko 1 year ago
parent 7928836d0d
commit c09976de6d

@ -344,7 +344,10 @@ def connect_db() -> Connection: # type: ignore
db_connect_method == 'config'
if db_connect_method == 'socket':
config._run_cmd_mysql_options = ['-u', db_user, '-S', db_socket]
config._run_cmd_mysql_options = [
'-h', str(db_host), '-P', str(db_port),
'-u', db_user, '-S', db_socket
]
try:
db_conn: Connection = pymysql.connect( # type: ignore
host=db_host,
@ -365,6 +368,7 @@ def connect_db() -> Connection: # type: ignore
shutdown(1)
elif db_connect_method == 'config':
config._run_cmd_mysql_options = [
'-h', str(db_host), '-P', str(db_port),
f'--defaults-extra-file={db_defaults_conf_file}'
]
try:

Loading…
Cancel
Save