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)