diff --git a/backend/utils/mysql/client/local.go b/backend/utils/mysql/client/local.go index e14eb80c3..54ed43b61 100644 --- a/backend/utils/mysql/client/local.go +++ b/backend/utils/mysql/client/local.go @@ -39,6 +39,7 @@ func (r *Local) Create(info CreateInfo) error { } if err := r.CreateUser(info); err != nil { + _ = r.ExecSQL(fmt.Sprintf("drop database if exists `%s`", info.Name), info.Timeout) return err } diff --git a/backend/utils/mysql/client/remote.go b/backend/utils/mysql/client/remote.go index c4479ac51..6ae7b71aa 100644 --- a/backend/utils/mysql/client/remote.go +++ b/backend/utils/mysql/client/remote.go @@ -40,6 +40,7 @@ func (r *Remote) Create(info CreateInfo) error { } if err := r.CreateUser(info); err != nil { + _ = r.ExecSQL(fmt.Sprintf("drop database if exists `%s`", info.Name), info.Timeout) return err }