From 229610a2c0aec1ba5c67a1d3514c7e91c7b7f670 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Sun, 19 Jan 2025 01:24:42 +0100 Subject: [PATCH] fix other workflows --- .github/workflows/golang-test-linux.yml | 11 ++++------- management/server/store/store.go | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/golang-test-linux.yml b/.github/workflows/golang-test-linux.yml index c27f38a693c..3e64b8bd711 100644 --- a/.github/workflows/golang-test-linux.yml +++ b/.github/workflows/golang-test-linux.yml @@ -219,7 +219,6 @@ jobs: if: matrix.store == 'mysql' run: | docker run -d \ - -e MYSQL_ALLOW_EMPTY_PASSWORD=true \ -p 3306:3306 \ --name my-mysql \ mlsmaycon/warmed-mysql:8 @@ -242,7 +241,7 @@ jobs: fi if [ "${{ matrix.store }}" = "mysql" ]; then - export NETBIRD_STORE_ENGINE_MYSQL_DSN="root:testing@tcp(localhost:3306)/testing?parseTime=True" + export NETBIRD_STORE_ENGINE_MYSQL_DSN="root:testing@tcp(localhost:3306)/testing" fi CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \ @@ -356,7 +355,7 @@ jobs: fi if [ "${{ matrix.store }}" = "mysql" ]; then - export NETBIRD_STORE_ENGINE_MYSQL_DSN="root:netbird@tcp(localhost:3306)/netbird?parseTime=True" + export NETBIRD_STORE_ENGINE_MYSQL_DSN="root:testing@tcp(localhost:3306)/testing" fi CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \ @@ -448,8 +447,6 @@ jobs: if: matrix.store == 'mysql' run: | docker run -d \ - -e MYSQL_ROOT_PASSWORD=netbird \ - -e MYSQL_DATABASE=netbird \ -p 3306:3306 \ --name my-mysql \ mlsmaycon/warmed-mysql:8 @@ -475,7 +472,7 @@ jobs: fi if [ "${{ matrix.store }}" = "mysql" ]; then - export NETBIRD_STORE_ENGINE_MYSQL_DSN="root:netbird@tcp(localhost:3306)/netbird?parseTime=True" + export NETBIRD_STORE_ENGINE_MYSQL_DSN="root:testing@tcp(localhost:3306)/testing" fi CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \ @@ -580,7 +577,7 @@ jobs: fi if [ "${{ matrix.store }}" = "mysql" ]; then - export NETBIRD_STORE_ENGINE_MYSQL_DSN="root:testing@tcp(localhost:3306)/testing?parseTime=True" + export NETBIRD_STORE_ENGINE_MYSQL_DSN="root:testing@tcp(localhost:3306)/testing" fi CGO_ENABLED=1 GOARCH=${{ matrix.arch }} \ diff --git a/management/server/store/store.go b/management/server/store/store.go index dc38c9e928a..12534b50282 100644 --- a/management/server/store/store.go +++ b/management/server/store/store.go @@ -389,7 +389,7 @@ func getSqlStoreEngine(ctx context.Context, store *SqlStore, kind Engine) (Store return nil, nil, fmt.Errorf("%s is not set", mysqlDsnEnv) } - db, err := gorm.Open(mysql.Open(dsn), getGormConfig()) + db, err := gorm.Open(mysql.Open(dsn+"?charset=utf8&parseTime=True&loc=Local"), getGormConfig()) if err != nil { return nil, cleanUp, fmt.Errorf("failed to open mysql connection: %v", err) }