mirror of
https://github.com/Kakune55/PyGetGPT.git
synced 2025-06-29 00:08:04 +08:00
20 lines
452 B
Python
20 lines
452 B
Python
import pymysql
|
|
#打开数据库连接
|
|
db = pymysql.connect(host='www.kakuweb.top',
|
|
port=33306,
|
|
user='root',
|
|
password='KAku3.14159..',
|
|
database='AIapi')
|
|
# 使用 cursor() 方法创建一个游标对象 cursor
|
|
cursor = db.cursor()
|
|
|
|
cursor.execute("DELETE FROM usersurplus WHERE surplus < 1;")
|
|
|
|
# 提交事务
|
|
db.commit()
|
|
|
|
# 关闭连接
|
|
db.close()
|
|
|
|
print("已完成删除")
|