From c3d40b51a0989e44feaca44f5d1e2baf8c1e5ff7 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 3 Feb 2021 00:32:06 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index d169610a0..cd56244e6 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -961,7 +961,12 @@ def setDbAccess(): psdb = pSqliteDb('databases') dbname = psdb.where('username=?', (name,)).getField('name') - password = psdb.where("username=?", (name,)).getField('password') + + if name == 'root': + password = pSqliteDb('config').where( + 'id=?', (1,)).getField('mysql_root') + else: + password = psdb.where("username=?", (name,)).getField('password') users = pdb.query("select Host from mysql.user where User='" + name + "' AND Host!='localhost'") for us in users: