mirror of
https://github.com/Kakune55/PyGetGPT.git
synced 2025-06-28 15:58:04 +08:00
将数据库配置放入配置文件保存
This commit is contained in:
parent
c1be38fd1e
commit
8608e88d15
@ -25,11 +25,11 @@ def userSurplus(userkey):
|
|||||||
|
|
||||||
def reduce_value(userkey, value): # 减去对应的值
|
def reduce_value(userkey, value): # 减去对应的值
|
||||||
#打开数据库连接
|
#打开数据库连接
|
||||||
db = pymysql.connect(host='www.kakuweb.top',
|
db = pymysql.connect(host=config.readConf()["db"]["host"],
|
||||||
port=33306,
|
port=config.readConf()["db"]["port"],
|
||||||
user='root',
|
user=config.readConf()["db"]["user"],
|
||||||
password='KAku3.14159..',
|
password=config.readConf()["db"]["passwd"],
|
||||||
database='AIapi')
|
database=config.readConf()["db"]["database"])
|
||||||
# 使用 cursor() 方法创建一个游标对象 cursor
|
# 使用 cursor() 方法创建一个游标对象 cursor
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user