Commit 58daaf7b authored by Andreas Valder's avatar Andreas Valder
Browse files

added a config option for the mysql port

parent 87cc01b1
......@@ -11,6 +11,7 @@ DB_DATA = 'db_example.sql'
#DB_ENGINE = 'mysql'
#MYSQL_HOST = 'localhost'
#MYSQL_USER = 'videoag'
#MYSQL_PORT = '3306'
#MYSQL_PASSWD = 'somuchsecret'
#MYSQL_DB = 'videos'
......
......@@ -47,7 +47,7 @@ elif config['DB_ENGINE'] == 'mysql':
def get_dbcursor():
if 'db' not in g or not g.db.is_connected():
g.db = mysql.connector.connect(user=config['MYSQL_USER'], password=config['MYSQL_PASSWD'], host=config['MYSQL_HOST'], database=config['MYSQL_DB'])
g.db = mysql.connector.connect(user=config['MYSQL_USER'], password=config['MYSQL_PASSWD'], host=config['MYSQL_HOST'], port=config['MYSQL_PORT'], database=config['MYSQL_DB'])
if not hasattr(request, 'db'):
request.db = g.db.cursor()
return request.db
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment