From cc7a3fe95930d71e24fcc1c2e12e903910266a6b Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 12 Jun 2022 16:21:21 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 0fb7d93fb..6ce86062a 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -335,7 +335,7 @@ def initMysql8Pwd(): mw.writeFile(tmp_file, alter_root_pwd) cmd_pass = serverdir + '/bin/mysql -uroot -p"' + password + '" < ' + tmp_file print(cmd_pass) - mw.execShell(cmd_pass) + print(mw.execShell(cmd_pass)) pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,)) return True @@ -377,6 +377,8 @@ def my8cmd(version, method): else: if method == "stop": mw.execShell(cmd) + mw.execShell( + "ps -ef|grep mysql|grep -v grep|awk '{print $2}'|xargs kill") return "ok" sub = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, bufsize=4096, stderr=subprocess.PIPE)