fix: update db connect charset and collation

This commit is contained in:
2023-11-07 11:02:57 +08:00
parent 56cff767a6
commit b46d4e23d2
12 changed files with 33 additions and 33 deletions

View File

@@ -34,7 +34,7 @@ func loadDialect() map[string]dialectInfo {
// 数据库类型对应的数据库连接
switch item["type"] {
case "mysql":
dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local",
dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&loc=Local",
item["username"],
item["password"],
item["host"],