Search code examples
mysqlsqlselectprivilegessql-grant

How to view only procedure related grants in MySQL?


I want to see only grant privileges on a particular procedure in MySQL. This documentation shows all grants.

Is there a way to see grants only for a particular procedure in a db.

The below command gives all grants including select, update etc. :

SHOW GRANTS FOR 'root'@'localhost';

Solution

  • Try this:

    SELECT *
    FROM mysql.procs_priv A
    WHERE A.Db = 'DatabaseName' AND A.User = 'root' AND 
          A.host = 'localhost' AND A.Routine_name = 'ProcedureName' AND 
          FIND_IN_SET('Grant', A.proc_priv);