Files
QingLong/AI/SyncData/connectors/mysql_connector.py

17 lines
399 B
Python
Raw Normal View History

2025-08-15 09:13:13 +08:00
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)