17 lines
399 B
Python
17 lines
399 B
Python
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)
|