奇淼(piexlmax
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
server/service/sys_initdb.go
|
@ -81,7 +81,7 @@ func InitDB(conf request.InitDB) error { |
|
|
conf.Port = "3306" |
|
|
conf.Port = "3306" |
|
|
} |
|
|
} |
|
|
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/", conf.UserName, conf.Password, conf.Host, conf.Port) |
|
|
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 { |
|
|
if err := createTable(dsn, "mysql", createSql); err != nil { |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|