How to show all stored procedures/functions in MySQL
In this tutorial, we are going to see how to show all stored procedures/functions in a MySQL database.
Show all stored procedures in MySQL
SHOW PROCEDURE STATUS;
Output:
+-----------+----------------+-------------+-----------------+ | Db | Name | Type | Definer | +-----------+----------------+-------------+-----------------+ | schoolDB | get_students | PROCEDURE | root@localhost | | schoolDB | get_profs | PROCEDURE | root@localhost | | schoolDB | get_max_mark | PROCEDURE | root@localhost | | studentDB | get_name | PROCEDURE | root@localhost | | studentDB | get_address | PROCEDURE | root@localhost | +-----------+----------------+-------------+-----------------+
The statement SHOW PROCEDURE STATUS displays all the characteristics of the stored procedures, including their names. It returns the stored procedures that you have the privilege to access.
Show all stored procedures specific to a database in MySQL
SHOW PROCEDURE STATUS WHERE Db = 'studentDB';
Output:
+-----------+----------------+-------------+-----------------+ | Db | Name | Type | Definer | +-----------+----------------+-------------+-----------------+ | studentDB | get_name | PROCEDURE | root@localhost | | studentDB | get_address | PROCEDURE | root@localhost | +-----------+----------------+-------------+-----------------+