diff --git a/backend/utils/mysql/client/local.go b/backend/utils/mysql/client/local.go index 0b3aa5916..ce2e3f9c3 100644 --- a/backend/utils/mysql/client/local.go +++ b/backend/utils/mysql/client/local.go @@ -147,7 +147,7 @@ func (r *Local) ChangePassword(info PasswordChangeInfo) error { for _, user := range userlist { passwordChangeSql := fmt.Sprintf("set password for %s = password('%s')", user, info.Password) if !strings.HasPrefix(info.Version, "5.7") && !strings.HasPrefix(info.Version, "5.6") { - passwordChangeSql = fmt.Sprintf("ALTER USER %s IDENTIFIED WITH mysql_native_password BY '%s';", user, info.Password) + passwordChangeSql = fmt.Sprintf("alter user %s identified by '%s';", user, info.Password) } if err := r.ExecSQL(passwordChangeSql, info.Timeout); err != nil { return err @@ -276,7 +276,7 @@ func (r *Local) SyncDB(version string) ([]SyncDBInfo, error) { From: r.From, Format: parts[1], } - userLines, err := r.ExecSQLForRows(fmt.Sprintf("SELECT USER,HOST FROM mysql.DB WHERE DB = '%s'", parts[0]), 300) + userLines, err := r.ExecSQLForRows(fmt.Sprintf("select user,host from mysql.db where db = '%s'", parts[0]), 300) if err != nil { return datas, err } diff --git a/backend/utils/mysql/client/remote.go b/backend/utils/mysql/client/remote.go index 131dff80e..7ab7354e0 100644 --- a/backend/utils/mysql/client/remote.go +++ b/backend/utils/mysql/client/remote.go @@ -263,7 +263,7 @@ func (r *Remote) Recover(info RecoverInfo) error { func (r *Remote) SyncDB(version string) ([]SyncDBInfo, error) { var datas []SyncDBInfo - rows, err := r.Client.Query("SELECT SCHEMA_NAME, DEFAULT_CHARACTER_SET_NAME FROM information_schema.SCHEMATA") + rows, err := r.Client.Query("select schema_name, default_character_set_name from information_schema.SCHEMATA") if err != nil { return datas, err } @@ -283,7 +283,7 @@ func (r *Remote) SyncDB(version string) ([]SyncDBInfo, error) { MysqlName: r.From, Format: charsetName, } - userRows, err := r.Client.Query("SELECT USER,HOST FROM mysql.DB WHERE DB = ?", dbName) + userRows, err := r.Client.Query("select user,host from mysql.db where db = ?", dbName) if err != nil { return datas, err } diff --git a/frontend/src/routers/modules/database.ts b/frontend/src/routers/modules/database.ts index efdb36754..2fc320484 100644 --- a/frontend/src/routers/modules/database.ts +++ b/frontend/src/routers/modules/database.ts @@ -27,6 +27,16 @@ const databaseRouter = { requiresAuth: false, }, }, + { + path: 'mysql/setting', + name: 'MySQL-Setting', + component: () => import('@/views/database/mysql/setting/index.vue'), + hidden: true, + meta: { + activeMenu: '/databases', + requiresAuth: false, + }, + }, { path: 'mysql/remote', name: 'MySQL-Remote', diff --git a/frontend/src/views/database/mysql/index.vue b/frontend/src/views/database/mysql/index.vue index 26b4665fa..b2c3a6eea 100644 --- a/frontend/src/views/database/mysql/index.vue +++ b/frontend/src/views/database/mysql/index.vue @@ -11,7 +11,7 @@ > -