Support using MySQL without a password

Fixes #568
pull/770/head
Matt Baer 1 year ago
parent 5d4ebb59c7
commit 3d8b8ecc93
  1. 4
      app.go

@ -569,8 +569,8 @@ func (app *App) InitDecoder() {
// tests the connection.
func ConnectToDatabase(app *App) error {
// Check database configuration
if app.cfg.Database.Type == driverMySQL && (app.cfg.Database.User == "" || app.cfg.Database.Password == "") {
return fmt.Errorf("Database user or password not set.")
if app.cfg.Database.Type == driverMySQL && app.cfg.Database.User == "" {
return fmt.Errorf("Database user not set.")
}
if app.cfg.Database.Host == "" {
app.cfg.Database.Host = "localhost"

Loading…
Cancel
Save