Sfoglia il codice sorgente

Merge pull request #770 from writefreely/passwordless-db

Support using MySQL without a password
pull/360/merge
Matt Baer 8 mesi fa
committed by GitHub
parent
commit
2986f83121
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      app.go

+ 2
- 2
app.go Vedi File

@@ -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"


Caricamento…
Annulla
Salva