From a7f73e10aee417554a15a0ac871283b3d9cc141b Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 7 Nov 2022 10:42:24 +0800 Subject: [PATCH] Update index.py --- plugins/mysql-apt/index.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/mysql-apt/index.py b/plugins/mysql-apt/index.py index c1d70cb4d..32e618d23 100755 --- a/plugins/mysql-apt/index.py +++ b/plugins/mysql-apt/index.py @@ -319,6 +319,10 @@ def initMysql8Data(): def initMysql8Pwd(): + ''' + /usr/bin/mysql --defaults-file=/www/server/mysql-apt/etc/my.cnf -uroot -e"UPDATE mysql.user SET password=PASSWORD('BhIroUczczNVaKvw') WHERE user='root';flush privileges;" + /usr/bin/mysql --defaults-file=/www/server/mysql-apt/etc/my.cnf -uroot -e"alter user 'root'@'localhost' identified by '123456';" + ''' time.sleep(5) serverdir = getServerDir() @@ -329,8 +333,7 @@ def initMysql8Pwd(): cmd_pass = cmd_my + ' --defaults-file=' + myconf + ' -uroot -e' cmd_pass = cmd_pass + \ - '"UPDATE mysql.user SET password=PASSWORD(\'' + \ - pwd + "') WHERE user='root';" + '"alter user \'root\'@\'localhost\' identified by \'' + pwd + '\';"' cmd_pass = cmd_pass + 'flush privileges;"' # print(cmd_pass) data = mw.execShell(cmd_pass)