4

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';
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Raghuram Vadapalli
  • 1,190
  • 2
  • 13
  • 27

3 Answers3

2

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);
Saharsh Shah
  • 28,687
  • 8
  • 48
  • 83
0

Use this command to grant execute privileges on specific procedure:

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

Reference

Muhammad Muazzam
  • 2,810
  • 6
  • 33
  • 62
0

Suppose, you want to create a procedure called MyFirstProc and you wanted to grant ALL users the ability to EXECUTE this procedure. You would run the following GRANT statement:

GRANT EXECUTE ON PROCEDURE MyFirstProc TO '*'@'localhost';
Muhammad Muazzam
  • 2,810
  • 6
  • 33
  • 62
Subho Ghose
  • 97
  • 1
  • 2
  • 13