def __init__(self):
self.__cfgReporting = Config(os.path.join(RAGPICKER_ROOT, 'config', 'reporting.conf'))
self.__mysqlEnabled = self.__cfgReporting.getOption("mysql", "enabled")
if self.__mysqlEnabled:
#Anbindung an Datenbank MySQL herstellen
try:
mysqlHost = self.__cfgReporting.getOption("mysql", "host")
mysqlPort = self.__cfgReporting.getOption("mysql", "port")
mysqlDatabase = self.__cfgReporting.getOption("mysql", "database")
mysqlUser = self.__cfgReporting.getOption("mysql", "user")
mysqlPassword = self.__cfgReporting.getOption("mysql", "password")
self.__mysqlConnection = MySQLdb.Connect(host=mysqlHost, port=mysqlPort, db=mysqlDatabase, user=mysqlUser, passwd=mysqlPassword)
except (Exception) as e:
raise Exception("Cannot connect to MySQL (ragpicker): %s" % e)
评论列表
文章目录