mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
parent
4ddb691524
commit
f8796bc55b
1 changed files with 4 additions and 1 deletions
|
|
@ -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 a new issue