Make use of declared db_host_port

The port to connect to MySQL-Server was previously always assumed as
the default one. So the library was incompatible to db's on nonstandard
ports

Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=68 FS#68]
This commit is contained in:
2016-08-23 21:12:07 +02:00
parent 944bea488a
commit bd9dbdfa17

View File

@@ -49,6 +49,7 @@ class MysqlRed:
# in descendant classes
connection = False
db_hostname = config.db_hostname
db_port = config.db_port
db_username = config.db_username
db_password = config.db_password
db_name = config.db_username + jogobot.config['db_suffix']
@@ -71,6 +72,7 @@ class MysqlRed:
type( self ).connection = mysqldb.connect(
host=type( self ).db_hostname,
port=type( self ).db_port,
user=type( self ).db_username,
passwd=type( self ).db_password,
db=type( self ).db_name )