Skip to content

Commit

Permalink
Revert "fix(mysql): 修改管理临时密码兼容账号不存在 #8006"
Browse files Browse the repository at this point in the history
This reverts commit 5654426.
  • Loading branch information
xfwduke committed Nov 18, 2024
1 parent 30d8866 commit 54ea511
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbm-services/mysql/db-priv/service/admin_password.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ func (m *ModifyAdminUserPasswordPara) ModifyAdminPasswordForMysql(
if !(*cluster.ClusterType == tendbcluster && role == machineTypeSpider) &&
MySQLVersionParse(mysqlVersion, "") >=
MySQLVersionParse("8.0.0", "") {
userLocalhost = fmt.Sprintf("ALTER USER IF EXISTS '%s'@'localhost' "+
userLocalhost = fmt.Sprintf("ALTER USER '%s'@'localhost' "+
"IDENTIFIED WITH mysql_native_password BY '%s'", m.UserName, psw)
userIp = fmt.Sprintf("ALTER USER IF EXISTS '%s'@'%s' "+
userIp = fmt.Sprintf("ALTER USER '%s'@'%s' "+
"IDENTIFIED WITH mysql_native_password BY '%s'", m.UserName, address.Ip, psw)
}
sqls = append(sqls, userLocalhost, userIp, setBinlogOn, flushPriv)
Expand Down

0 comments on commit 54ea511

Please sign in to comment.