mysql: use collation instead of charset (#9156)

- use charset would issue additional 'SET NAMES <VALUE>' queries, set
collation would be better. see: https://github.com/go-sql-driver/mysql#charset
This commit is contained in:
mxlxm
2017-09-04 12:32:07 +02:00
committed by Torkel Ödegaard
parent c3cffeb10c
commit c5400ffe76
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ func getEngine() (*xorm.Engine, error) {
protocol = "unix"
}
cnnstr = fmt.Sprintf("%s:%s@%s(%s)/%s?charset=utf8mb4&allowNativePasswords=true",
cnnstr = fmt.Sprintf("%s:%s@%s(%s)/%s?collation=utf8mb4_unicode_ci&allowNativePasswords=true",
DbCfg.User, DbCfg.Pwd, protocol, DbCfg.Host, DbCfg.Name)
if DbCfg.SslMode == "true" || DbCfg.SslMode == "skip-verify" {