From d25100fec324be356c70657a17ebaceeb7d85969 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 31 Dec 2022 20:01:20 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 23105772d..a135044bb 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -1968,20 +1968,18 @@ def addMasterRepSlaveUser(version=''): if isError != None: return isError - sql = "FLUSH PRIVILEGES;" - pdb.execute(sql) else: sql = "grant replication SLAVE ON *.* TO '" + username + \ "'@'%' identified by '" + password + "';" result = pdb.execute(sql) - - sql_select = "grant select on *.* to " + username + "@%;" - - result = pdb.execute('FLUSH PRIVILEGES;') isError = isSqlError(result) if isError != None: return isError + sql_select = "grant select,lock tables,PROCESS on *.* to " + username + "@'%';" + pdb.execute(sql_select) + pdb.execute('FLUSH PRIVILEGES;') + addTime = time.strftime('%Y-%m-%d %X', time.localtime()) psdb.add('username,password,accept,ps,addtime', (username, password, '%', '', addTime))