mysql.go
389 Bytes
package database
import (
"log"
_ "github.com/Go-SQL-Driver/MySQL"
"github.com/lunny/xorm"
)
var Engine *xorm.Engine
func init() {
var err error
Engine, err = xorm.NewEngine("mysql", "trump:Trump123@(rm-2zeia588lj1117u37o.mysql.rds.aliyuncs.com:3306)/icesimbasdk_test?charset=utf8")
if err != nil {
log.Fatal(err)
}
if err = Engine.Ping(); err != nil {
log.Fatal(err)
}
}