如何查看具有相同授权的所有用户

时间:2018-02-26 16:29:02

标签: mysql stored-procedures mariadb privilege

我想列出拥有共同权限的用户。 例如,我想听取所有不能执行特定存储过程的用户。

有什么想法吗?

提前谢谢

1 个答案:

答案 0 :(得分:0)

SELECT user, host FROM mysql.user WHERE Execute_priv = 'N';

SELECT  DISTINCT a.grantee
    FROM  information_schema.user_privileges AS a
    WHERE  NOT EXISTS(
        SELECT  *
            FROM  information_schema.user_privileges
            WHERE  grantee = a.grantee
              AND  privilege_type = "EXECUTE" 
                     );