mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 18:26:16 +00:00
fix: mysql密码中有特殊字符导致拼接的MysqlDns错误
This commit is contained in:
@@ -3,6 +3,7 @@ package config
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/spf13/viper"
|
||||
"net/url"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
@@ -41,8 +42,8 @@ func Init() {
|
||||
RuntimePath,
|
||||
viper.GetString("log_save_path"))
|
||||
MysqlDns = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||
viper.GetString("mysql_user"),
|
||||
viper.GetString("mysql_passwd"),
|
||||
url.QueryEscape(viper.GetString("mysql_user")),
|
||||
url.QueryEscape(viper.GetString("mysql_passwd")),
|
||||
fmt.Sprintf(
|
||||
"%s:%s",
|
||||
viper.GetString("mysql_host"),
|
||||
|
||||
Reference in New Issue
Block a user