This commit is contained in:
2024-11-10 22:08:03 +08:00
parent bdd08285e7
commit 4d6afae559
2 changed files with 1 additions and 26 deletions

View File

@@ -19,29 +19,3 @@ pool = PooledDB(
database=MYSQL_NAME,
charset='utf8mb4'
)
## 创建 MySQL 连接
#def create_connection():
# return pymysql.connect(
# host=MYSQL_HOST,
# user=MYSQL_USER,
# port=MYSQL_PORT, # 应该使用 MYSQL_PORT 而不是 MYSQL_HOST
# password=MYSQL_PASS,
# database=MYSQL_NAME,
# local_infile=True,
# cursorclass=pymysql.cursors.DictCursor
# )
#
## 连接 MySQL (开启 MySQL 服务)
#conn = create_connection()
#
## 获取 MySQL 连接
#def get_cursor():
# global conn
# try:
# conn.ping()
# return conn.cursor()
# except Exception:
# conn = create_connection()
# return conn.cursor()
#