mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
parent
4ddb691524
commit
f8796bc55b
@ -6,6 +6,7 @@ import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/WatchBeam/clock"
|
||||
@ -271,12 +272,14 @@ func registerTLS(config config.MysqlConfig) error {
|
||||
// generateMysqlConnectionString returns a MySQL connection string using the
|
||||
// provided configuration.
|
||||
func generateMysqlConnectionString(conf config.MysqlConfig) string {
|
||||
tz := url.QueryEscape("'-00:00'")
|
||||
dsn := fmt.Sprintf(
|
||||
"%s:%s@(%s)/%s?charset=utf8mb4&parseTime=true&loc=UTC&clientFoundRows=true&allowNativePasswords=true",
|
||||
"%s:%s@(%s)/%s?charset=utf8mb4&parseTime=true&loc=UTC&time_zone=%s&clientFoundRows=true&allowNativePasswords=true",
|
||||
conf.Username,
|
||||
conf.Password,
|
||||
conf.Address,
|
||||
conf.Database,
|
||||
tz,
|
||||
)
|
||||
|
||||
if conf.TLSConfig != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user