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.
|
import pymysql
|
|
|
|
|
|
class MySQLConnector:
|
|
def __init__(self, config):
|
|
self.config = config
|
|
|
|
# 读取数据的连接
|
|
def connect(self):
|
|
return pymysql.connect(
|
|
cursorclass=pymysql.cursors.SSCursor,
|
|
**self.config
|
|
)
|
|
# 统计个数的连接
|
|
def create_count_connection(self):
|
|
return pymysql.connect(**self.config)
|