mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 11:24:13 +00:00
Merge pull request #770 from writefreely/passwordless-db
Support using MySQL without a password
This commit is contained in:
commit
2986f83121
1 changed files with 2 additions and 2 deletions
4
app.go
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…
Reference in a new issue