From e7448f57a4d000c855895c0abab3ebdfc99681d8 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 6 Jul 2022 14:23:11 +0800 Subject: [PATCH] Update index.py --- plugins/mysql-ya/index.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/mysql-ya/index.py b/plugins/mysql-ya/index.py index 8fcd081f7..b6490f66b 100755 --- a/plugins/mysql-ya/index.py +++ b/plugins/mysql-ya/index.py @@ -302,16 +302,17 @@ def initMysql8Pwd(): "alter user 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '" + pwd + "';" alter_root_pwd = alter_root_pwd + "flush privileges;" - cmd_pass = 'mysqladmin -uroot password root' + cmd_pass = 'mysqladmin --defaults-file=' + \ + getServerDir() + '/etc/my.cnf -uroot password root' data = mw.execShell(cmd_pass) - # print(data) + print(data) tmp_file = "/tmp/mysql_ya_init_tmp.log" mw.writeFile(tmp_file, alter_root_pwd) cmd_pass = 'mysql -uroot -proot < ' + tmp_file data = mw.execShell(cmd_pass) - # print(data) + print(data) os.remove(tmp_file) pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (pwd,))