Update index.py

This commit is contained in:
dami
2025-07-27 16:49:17 +08:00
parent 6f6523836d
commit a6fe7e2fe3
+2 -1
View File
@@ -1519,7 +1519,8 @@ def setRootPwdForce(new_password,version=''):
# 设置新密码
cmd_newpass = serverdir+f"/bin/mysql -u root -e \"ALTER USER 'root'@'localhost' IDENTIFIED BY '{new_password}'; FLUSH PRIVILEGES;\""
data = mw.execShell(cmd_newpass)
print(cmd_newpass, "新密码",data)
print("新密码",cmd_newpass)
print(data)
# 验证密码
cmd = serverdir+f"/bin/mysql -u root -p'{new_password}' -e 'SHOW DATABASES;'"