From c09976de6d28818a2bc88cae99703189e70634de Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Thu, 7 Dec 2023 15:37:10 +0100 Subject: [PATCH] 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 --- ngcp-update-db-schema | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ngcp-update-db-schema b/ngcp-update-db-schema index 8fdae7c0..4a96b874 100755 --- a/ngcp-update-db-schema +++ b/ngcp-update-db-schema @@ -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: