How to view only procedure-related grants in MySQL?

I want to see only privileges of granting rights to a certain procedure in MySQL. This documentation shows all grants.

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

The team below provides all the grants, including selection, updating, etc.:

SHOW GRANTS FOR 'root'@'localhost';
+4
source share
3 answers

Try the following:

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);
+2
source

Use this command to provide startup privileges for a specific procedure:

GRANT EXECUTE ON PROCEDURE schema_name.proc_name TO 'user_name';

Link

0
source

Suppose you want to create a procedure called MyFirstProc, and you would like to give all users the opportunity to RUN this procedure. You must run the following GRANT statement:

GRANT EXECUTE ON PROCEDURE MyFirstProc TO '*'@'localhost';
0
source

Source: https://habr.com/ru/post/1621206/


All Articles