diff --git a/database/database.go b/database/database.go index 0546dc3..02fb820 100644 --- a/database/database.go +++ b/database/database.go @@ -18,11 +18,10 @@ var Os *opensearch.Client func DSN() string { return fmt.Sprintf( - "%s:%s@tcp(%s:%s)/%s?charset=utf8&parseTime=True&loc=Local", + "%s:%s@tcp(%s)/%s", setting.Database.Username, setting.Database.Password, setting.Database.Host, - setting.Database.Port, setting.Database.Database, ) } diff --git a/setting/database.go b/setting/database.go index a64f78e..547ca37 100644 --- a/setting/database.go +++ b/setting/database.go @@ -3,7 +3,6 @@ package setting type DatabaseSetting struct { Driver string Host string - Port string Database string Username string Password string @@ -18,7 +17,6 @@ func DatabaseSetup() *DatabaseSetting { Database.Logging = env("DB_LOGGING", "false") Database.Driver = env("DB_DRIVER", "mysql") Database.Host = env("DB_HOST", "localhost") - Database.Port = env("DB_PORT", "3306") Database.Database = env("DB_DATABASE", "tonic") Database.Username = env("DB_USERNAME", "root") Database.Password = env("DB_PASSWORD", "")