mysql.go
777 字节
package constant
import "fmt"
var MYSQL_DB_NAME = "mmm_open_dev"
var MYSQL_USER = "root"
var MYSQL_PASSWORD = "eagle1010"
var MYSQL_HOST = "114.55.200.59"
var MYSQL_PORT = "23306"
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,
)
}