From 4ba8d2f866dc93d7fbd5814719dbbb3021999687 Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Wed, 30 Jun 2021 12:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=B9=E6=AE=8A=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E4=B8=8B=E5=88=9D=E5=A7=8B=E5=8C=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=97=B6=E6=8A=A5=E9=94=99=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/service/sys_initdb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/service/sys_initdb.go b/server/service/sys_initdb.go index 44e4ec70..b84a0868 100644 --- a/server/service/sys_initdb.go +++ b/server/service/sys_initdb.go @@ -81,7 +81,7 @@ func InitDB(conf request.InitDB) error { conf.Port = "3306" } dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/", conf.UserName, conf.Password, conf.Host, conf.Port) - createSql := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_general_ci;", conf.DBName) + createSql := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS `%s` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_general_ci;", conf.DBName) if err := createTable(dsn, "mysql", createSql); err != nil { return err }