Stored Procedure Permissions : Procedure « Procedure Function « MySQL Tutorial






Specific to procedures, the MySQL permissions scheme has the CREATE ROUTINE, ALTER ROUTINE, and EXECUTE privilege.

The permissions required for working with stored procedures are as follows:

Viewing permissions

To view stored procedures with SHOW PROCEDURE STATUS, you must have SELECT access to the mysql.proc table.

Or you must have the ALTER ROUTINE privilege for that particular procedure.

Calling permissions

To call a stored procedure

You need the ability to connect to the server and have the EXECUTE permission for the procedure.

EXECUTE permissions can be granted globally in the mysql.user table.

EXECUTE permissions can be granted at the database level in the mysql.db table

EXECUTE permissions can be granted for a specific routine in the mysql.procs_priv table.

Creating and altering permissions

To govern creating and altering a stored procedure, MySQL uses the CREATE ROUTINE and ALTER ROUTINE privilege.

Permissions for creating or changing procedures can be granted globally in the mysql.user table.

Permissions for creating or changing procedures can be granted at the database level in the mysql.db table.

Permissions for creating or changing procedures can be granted for a specific routine in the mysql.procs_priv table.

Dropping permissions

To drop a procedure, you must have the ALTER ROUTINE privilege.

Permissions for dropping procedures can be granted globally in the mysql.user table.

Permissions for dropping procedures can be granted at the database level in the mysql.db table.

Permissions for dropping procedures can be granted for a specific routine in the mysql.procs_priv table.









11.5.Procedure
11.5.1.The CREATE PROCEDURE Statement
11.5.2.You can set parameters for a stored procedure
11.5.3.Using an OUT parameter.
11.5.4.The stored procedure characteristics include a number of options for how the stored procedure behaves.
11.5.5.Creating a Single-Statement Procedure
11.5.6.Calling a Single-Statement Procedure
11.5.7.Creating a Multistatement Stored Procedure
11.5.8.The ALTER statement lets you change the characteristics of a stored procedure
11.5.9.To remove a stored procedures, use the DROP statement
11.5.10.ALTER PROCEDURE and ALTER FUNCTION Syntax
11.5.11.DROP PROCEDURE and DROP FUNCTION Syntax
11.5.12.Stored Procedure Permissions