From 279f8f0e6c4c42168ca4b448e571f2146189bafc Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Wed, 13 Sep 2023 18:30:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20MySQL=208.x=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=95=B0=E6=8D=AE=E5=BA=93=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=AF=BC=E8=87=B4=E5=88=9B=E5=BB=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#2281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/utils/mysql/client/local.go | 4 ++-- backend/utils/mysql/client/remote.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/utils/mysql/client/local.go b/backend/utils/mysql/client/local.go index 9e2208c37..6eac5a9e5 100644 --- a/backend/utils/mysql/client/local.go +++ b/backend/utils/mysql/client/local.go @@ -72,9 +72,9 @@ func (r *Local) CreateUser(info CreateInfo, withDeleteDB bool) error { Timeout: 300}) return err } - grantStr := fmt.Sprintf("grant all privileges on `%s`.* to %s", info.Name, user) + grantStr := fmt.Sprintf("grant all privileges on `%s`.* to %s with grant option;", info.Name, user) if info.Name == "*" { - grantStr = fmt.Sprintf("grant all privileges on *.* to %s", user) + grantStr = fmt.Sprintf("grant all privileges on *.* to %s with grant option;", user) } if strings.HasPrefix(info.Version, "5.7") || strings.HasPrefix(info.Version, "5.6") { grantStr = fmt.Sprintf("%s identified by '%s' with grant option;", grantStr, info.Password) diff --git a/backend/utils/mysql/client/remote.go b/backend/utils/mysql/client/remote.go index 01a59d6fd..887f09b02 100644 --- a/backend/utils/mysql/client/remote.go +++ b/backend/utils/mysql/client/remote.go @@ -75,9 +75,9 @@ func (r *Remote) CreateUser(info CreateInfo, withDeleteDB bool) error { } return err } - grantStr := fmt.Sprintf("grant all privileges on `%s`.* to %s", info.Name, user) + grantStr := fmt.Sprintf("grant all privileges on `%s`.* to %s with grant option;", info.Name, user) if info.Name == "*" { - grantStr = fmt.Sprintf("grant all privileges on *.* to %s", user) + grantStr = fmt.Sprintf("grant all privileges on *.* to %s with grant option;", user) } if strings.HasPrefix(info.Version, "5.7") || strings.HasPrefix(info.Version, "5.6") { grantStr = fmt.Sprintf("%s identified by '%s' with grant option;", grantStr, info.Password)