From 3b91d0c5ad5c875135fd621be96a4a066a2abb4b Mon Sep 17 00:00:00 2001 From: YangPeng Date: Sat, 23 Oct 2021 16:53:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E5=88=9B=E5=BB=BA=E6=95=B0=E6=8D=AE=E5=BA=93=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 数据库相关配置统一由 common 模块中的 MYSQL_XX 字段进行配置 --- jobs/basic_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs/basic_job.py b/jobs/basic_job.py index 86bb3015..09e7c77e 100644 --- a/jobs/basic_job.py +++ b/jobs/basic_job.py @@ -103,7 +103,7 @@ def stat_all(tmp_datetime): # 创建新数据库。 def create_new_database(): - with MySQLdb.connect(common.MYSQL_HOST, common.MYSQL_USER, common.MYSQL_PWD, "mysql", charset="utf8") as db: + with MySQLdb.connect(common.MYSQL_HOST, common.MYSQL_USER, common.MYSQL_PWD, common.MYSQL_DB, charset="utf8") as db: try: create_sql = " CREATE DATABASE IF NOT EXISTS %s CHARACTER SET utf8 COLLATE utf8_general_ci " % common.MYSQL_DB print(create_sql)