Update index.py

This commit is contained in:
Mr Chen
2023-12-22 22:32:59 +08:00
parent 0cbb1ad02e
commit 4b3104c849
+2 -1
View File
@@ -432,6 +432,7 @@ def initMysql8Pwd():
serverdir = getServerDir()
myconf = serverdir + "/etc/my.cnf"
pwd = mw.getRandomString(16)
auth_policy = getAuthPolicy()
cmd_my = serverdir + '/bin/usr/bin/mysql'
@@ -439,7 +440,7 @@ def initMysql8Pwd():
cmd_pass = cmd_pass + \
'"alter user \'root\'@\'localhost\' identified by \'' + pwd + '\';'
cmd_pass = cmd_pass + \
"alter user 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '" + pwd + "';"
"alter user 'root'@'localhost' IDENTIFIED WITH "+auth_policy+" by '" + pwd + "';"
cmd_pass = cmd_pass + 'flush privileges;"'
# print(cmd_pass)
data = mw.execShell(cmd_pass)