From 8ccbe8e7a677148dcd01d0a19346f24eb844e553 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 27 Jul 2025 16:17:02 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 5eec0b5ad..c5b9639f9 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -1501,13 +1501,16 @@ def setRootPwdForce(new_password,version=''): data = mw.execShell(cmd_clear_root) print("cmd_clear_root",data) + data = mw.execShell("ps -ef|grep mysql|grep -v plugins |grep -v grep | awk '{print $2}'| xargs kill") + print(data) + # 停止安全模式 safe_process.terminate() safe_process.wait() # 正常启动MySQL start(version) - time.sleep(3) + time.sleep(1) # 设置新密码 mw.execShell(serverdir+f"/bin/mysql -u root -e \"ALTER USER 'root'@'localhost' IDENTIFIED BY '{new_password}'; FLUSH PRIVILEGES;\"")