You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
397 B

5 months ago
import pymysql
class MySQLConnector:
def __init__(self, config):
self.config = config
5 months ago
# 读取数据的连接
5 months ago
def connect(self):
return pymysql.connect(
cursorclass=pymysql.cursors.SSCursor,
**self.config
)
5 months ago
# 统计个数的连接
5 months ago
def create_count_connection(self):
return pymysql.connect(**self.config)