Skip to content

Commit bcc8801

Browse files
authored
Merge pull request #481 from Hello-Hyman/MysqlBugfix
Mysql plugin specified port bug fix
2 parents bf2a788 + 7281d54 commit bcc8801

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

mqttwarn/services/mysql.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def plugin(srv, item):
5555
conn = MySQLdb.connect(host=host,
5656
user=user,
5757
passwd=passwd,
58-
db=dbname)
58+
db=dbname,
59+
port=port)
5960
cursor = conn.cursor()
6061
except Exception as e:
6162
srv.logging.warn("Cannot connect to mysql: %s" % e)

mqttwarn/services/mysql_dynamic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ def plugin(srv, item):
101101
conn = MySQLdb.connect(host=host,
102102
user=user,
103103
passwd=passwd,
104-
db=dbname)
104+
db=dbname,
105+
port=port)
105106
cursor = conn.cursor()
106107
except Exception as e:
107108
srv.logging.warn("Cannot connect to mysql: %s" % e)

mqttwarn/services/mysql_remap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def plugin(srv, item):
6565
return False
6666

6767
try:
68-
conn = MySQLdb.connect(host=host, user=user, passwd=passwd, db=dbname)
68+
conn = MySQLdb.connect(host=host, user=user, passwd=passwd, db=dbname, port=port)
6969
cursor = conn.cursor()
7070
except Exception as e:
7171
srv.logging.warn("Cannot connect to mysql: %s" % e)

0 commit comments

Comments
 (0)