mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-08 01:20:07 +08:00
fix: 解决版本升级导致无法创建数据库的问题 (#2108)
This commit is contained in:
parent
17062da52e
commit
e5a7f104f1
@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/buserr"
|
"github.com/1Panel-dev/1Panel/backend/buserr"
|
||||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||||
"github.com/1Panel-dev/1Panel/backend/utils/cmd"
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/utils/mysql/client"
|
"github.com/1Panel-dev/1Panel/backend/utils/mysql/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -28,9 +27,6 @@ type MysqlClient interface {
|
|||||||
|
|
||||||
func NewMysqlClient(conn client.DBInfo) (MysqlClient, error) {
|
func NewMysqlClient(conn client.DBInfo) (MysqlClient, error) {
|
||||||
if conn.From == "local" {
|
if conn.From == "local" {
|
||||||
if cmd.CheckIllegal(conn.Address, conn.Username, conn.Password) {
|
|
||||||
return nil, buserr.New(constant.ErrCmdIllegal)
|
|
||||||
}
|
|
||||||
connArgs := []string{"exec", conn.Address, "mysql", "-u" + conn.Username, "-p" + conn.Password, "-e"}
|
connArgs := []string{"exec", conn.Address, "mysql", "-u" + conn.Username, "-p" + conn.Password, "-e"}
|
||||||
return client.NewLocal(connArgs, conn.Address, conn.Password, conn.From), nil
|
return client.NewLocal(connArgs, conn.Address, conn.Password, conn.From), nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user