mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update index.py
This commit is contained in:
@@ -1815,17 +1815,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)
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user