|
@ -51,8 +51,10 @@ func (store *MysqlStore) initialize(user, password, hostname string, port int, d |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
sqlUrl := fmt.Sprintf(CONNECTION_URL_PATTERN, user, password, hostname, port, database) |
|
|
sqlUrl := fmt.Sprintf(CONNECTION_URL_PATTERN, user, password, hostname, port, database) |
|
|
|
|
|
adaptedSqlUrl := fmt.Sprintf(CONNECTION_URL_PATTERN, user, "<ADAPTED>", hostname, port, database) |
|
|
if interpolateParams { |
|
|
if interpolateParams { |
|
|
sqlUrl += "&interpolateParams=true" |
|
|
sqlUrl += "&interpolateParams=true" |
|
|
|
|
|
adaptedSqlUrl += "&interpolateParams=true" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var dbErr error |
|
|
var dbErr error |
|
@ -60,7 +62,7 @@ func (store *MysqlStore) initialize(user, password, hostname string, port int, d |
|
|
if dbErr != nil { |
|
|
if dbErr != nil { |
|
|
store.DB.Close() |
|
|
store.DB.Close() |
|
|
store.DB = nil |
|
|
store.DB = nil |
|
|
return fmt.Errorf("can not connect to %s error:%v", sqlUrl, err) |
|
|
|
|
|
|
|
|
return fmt.Errorf("can not connect to %s error:%v", adaptedSqlUrl, err) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
store.DB.SetMaxIdleConns(maxIdle) |
|
|
store.DB.SetMaxIdleConns(maxIdle) |
|
|