diff --git a/app/db/db.go b/app/db/db.go index a254e18..a76929d 100644 --- a/app/db/db.go +++ b/app/db/db.go @@ -11,7 +11,7 @@ var ( ) func InitAdminDb() { - dsn := `admin1:XUztIJWW!sr6bJqWK85CJ7kN@tcp(172.28.16.6:3306)/new_admin?charset=utf8&parseTime=true&loc=Asia%2FShanghai` // 保存sql记录的数据库连接 + dsn := `root:admin123@tcp(127.0.0.1:3306)/main?charset=utf8&parseTime=true&loc=Asia%2FShanghai` // 保存sql记录的数据库连接 var err error db, err = gorm.Open(mysql.Open(dsn)) diff --git a/main.go b/main.go index 764341b..3bba619 100644 --- a/main.go +++ b/main.go @@ -32,7 +32,9 @@ func main() { zlog.Infof("server version: %s", conf.App.ServerVersion) zlog.Infof("remote db: %s", conf.App.RemoteDb) - db.InitAdminDb() + if conf.App.SaveLog { + db.InitAdminDb() + } // todb if conf.App.WebAddr != "" {