mysql.go
779 字节
package constant
import "fmt"
var MYSQL_DB_NAME = "mmm_open_dev"
var MYSQL_USER = "root"
var MYSQL_PASSWORD = "sutianxia2018"
var MYSQL_HOST = "101.37.68.23"
var MYSQL_PORT = "3306"
var MYSQL_DATA_SOURCE = ""
var MYSQL_MAX_IDLE = 100
var MYSQL_MAX_OPEN = 100
func init() {
MYSQL_USER = config.StringDefault("MYSQL_USER", MYSQL_USER)
MYSQL_PASSWORD = config.StringDefault("MYSQL_PASSWORD", MYSQL_PASSWORD)
MYSQL_HOST = config.StringDefault("MYSQL_HOST", MYSQL_HOST)
MYSQL_PORT = config.StringDefault("MYSQL_PORT", MYSQL_PORT)
MYSQL_DB_NAME = config.StringDefault("MYSQL_DB_NAME", MYSQL_DB_NAME)
MYSQL_DATA_SOURCE = fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?loc=Asia%%2FShanghai&charset=utf8mb4",
MYSQL_USER,
MYSQL_PASSWORD,
MYSQL_HOST,
MYSQL_PORT,
MYSQL_DB_NAME,
)
}