@@ -10,8 +10,16 @@ class PQMySQL(object):
PQ Mysql
"""
- @retryOnTimeout()
def __init__(self):
+ self.connection = None
+ self.connect_to_db()
+
+ @retryOnTimeout()
+ def connect_to_db(self):
+ """
+ 连接 数据库
+ :return:
self.connection = pymysql.connect(
host='rm-bp1159bu17li9hi94.mysql.rds.aliyuncs.com',
port=3306,