def checkUserDbGrants(self, username):
if self.cursor is None:
self.connect()
self.cursor.execute("select Drop_priv, Grant_priv, References_priv,Create_tmp_table_priv,"
"Lock_tables_priv,Create_routine_priv,Alter_routine_priv,Execute_priv,"
"Event_priv,Trigger_priv from mysql.db "
"where User ='%s'" % username)
res = self.cursor.fetchall()
flag = 0
for row in res:
# print row
for key, value in row.items():
if value == 'Y':
flag = 1
LOg.log_warn('setting %s = %s is suggested!' % (key, 'N'))
if (flag == 0):
Log.log_pass('All the setting are approriate!')
评论列表
文章目录