mirror of
https://github.com/Kakune55/PyGetGPT.git
synced 2025-06-29 00:08:04 +08:00
26 lines
689 B
Python
26 lines
689 B
Python
import uuid , pymysql
|
|
|
|
surplus = int(input("usrplus:"))
|
|
number = int(input("number:"))
|
|
#打开数据库连接
|
|
db = pymysql.connect(host='www.kakuweb.top',
|
|
port=33306,
|
|
user='root',
|
|
password='KAku3.14159..',
|
|
database='AIapi')
|
|
# 使用 cursor() 方法创建一个游标对象 cursor
|
|
cursor = db.cursor()
|
|
for i in range(0,number):
|
|
tempuuid = uuid.uuid4()
|
|
print(tempuuid)
|
|
# 使用 execute() 方法执行 SQL 查询
|
|
cursor.execute(f"INSERT INTO usersurplus (userkey, surplus) VALUES ('{tempuuid}', {surplus});")
|
|
|
|
# 提交事务
|
|
db.commit()
|
|
|
|
# 关闭连接
|
|
db.close()
|
|
|
|
print("生成完成")
|
|
input() |