How to see all users who have same grant

28 Views Asked by At

I want to list the user who have a common privilege. For example, I wwant to liste all users who cant execute a specific stored procedure.

Any ideas ?

Thank you in advance

2

There are 2 best solutions below

0
Léo R. On

You can start with this :

SELECT * FROM information_schema.user_privileges where PRIVILEGE_TYPE ="TRIGGER"
0
Rick James On
SELECT user, host FROM mysql.user WHERE Execute_priv = 'N';

or

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" 
                     );