Skip to content

Commit 80bd93c

Browse files
author
J
committed
Port (--src-port) cli/config setting was being ignored
1 parent 79df309 commit 80bd93c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

clickhouse_mysql/dbclient/mysqlclient.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def connect(self, db):
5858
try:
5959
self.connection = MySQLdb.connect(
6060
host=self.host,
61+
port=self.port,
6162
user=self.user,
6263
passwd=self.password,
6364
db=db,
@@ -66,15 +67,17 @@ def connect(self, db):
6667
use_unicode=True,
6768
)
6869
self.cursor = self.connection.cursor()
69-
logging.debug("Connect to the database host={} user={} password={} db={}".format(
70+
logging.debug("Connect to the database host={} port={} user={} password={} db={}".format(
7071
self.host,
72+
self.port,
7173
self.user,
7274
self.password,
7375
db
7476
))
7577
except:
76-
raise Exception("Can not connect to the database host={} user={} password={} db={}".format(
78+
raise Exception("Can not connect to the database host={} port={} user={} password={} db={}".format(
7779
self.host,
80+
self.port,
7881
self.user,
7982
self.password,
8083
db
@@ -106,8 +109,9 @@ def tables_list(self, db):
106109

107110
except Exception as err:
108111
logging.debug("Unexpected error: {}".format(str(err)))
109-
raise Exception("Can not list tables on host={} user={} password={} db={}".format(
112+
raise Exception("Can not list tables on host={} port={} user={} password={} db={}".format(
110113
self.host,
114+
self.port,
111115
self.user,
112116
self.password,
113117
db

0 commit comments

Comments
 (0)