|
|
|
@ -26,11 +26,11 @@ class ORM: |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS, |
|
|
|
|
port=self.__DB_PORT, charset=self.__DB_CHARSET, connect_timeout=1, cursorclass=pymysql.cursors.DictCursor) |
|
|
|
|
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1, cursorclass=pymysql.cursors.DictCursor) |
|
|
|
|
except Exception as e: |
|
|
|
|
self.__DB_HOST = '127.0.0.1' |
|
|
|
|
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS, |
|
|
|
|
port=self.__DB_PORT, charset=self.__DB_CHARSET, connect_timeout=1, cursorclass=pymysql.cursors.DictCursor) |
|
|
|
|
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1, cursorclass=pymysql.cursors.DictCursor) |
|
|
|
|
|
|
|
|
|
self.__DB_CUR = self.__DB_CONN.cursor() |
|
|
|
|
return True |
|
|
|
|