MySQL Listing MySQL · Stored Procedure · Listing

Listing Stored Procedures

Master listing MySQL stored procedures — SHOW PROCEDURE STATUS with LIKE and WHERE clauses, querying information_schema.ROUTINES with proper routine_type and routine_schema filters, viewing routine_definition for source code, and using MySQL Workbench for visual browsing.

On a real system you'll often need to discover what stored procedures exist — to audit a database, find a procedure by name pattern, see who created it, or check when it was last modified. MySQL gives you three tools:

ToolBest for
SHOW PROCEDURE STATUSQuick listing across all databases — name, type, definer, dates, comment
information_schema.ROUTINESFull-fidelity programmatic access — joinable, filterable, scriptable
MySQL Workbench / DBeaverGUI browsing — expand the schema and click through
SHOW PROCEDURE STATUS [LIKE 'pattern' | WHERE search_condition];

Returns one row per procedure that the current user has permission to see, with these columns: Db, Name, Type, Definer, Modified, Created, Security_type, Comment, character_set_client, collation_connection, Database Collation.

Example 1 — All Procedures on the Server
MySQL — Show all
SHOW PROCEDURE STATUS;
OUTPUT
mysql — show procedure status
mysql>SHOW PROCEDURE STATUS;
+---------+--------------+-----------+----------------+---------------------+---------------------+---------------+----------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment |
+---------+--------------+-----------+----------------+---------------------+---------------------+---------------+----------------------+
| gowtham | emp | PROCEDURE | root@localhost | 2026-04-22 14:18:02 | 2026-04-22 14:00:11 | DEFINER | Get employees |
| gowtham | GetEmployees | PROCEDURE | root@localhost | 2026-04-22 11:30:15 | 2026-04-22 11:30:15 | DEFINER | Get all employees |
| gowtham | GetTotalEmp | PROCEDURE | root@localhost | 2026-04-22 11:42:51 | 2026-04-22 11:42:51 | DEFINER | |
+---------+--------------+-----------+----------------+---------------------+---------------------+---------------+----------------------+
3 rows in set (0.01 sec)
Example 2 — Filter by Database with WHERE

To narrow the listing to procedures in one specific database, add a WHERE clause:

MySQL — One database
SHOW PROCEDURE STATUS WHERE Db = 'gowtham';

You can use any SQL boolean expression in WHERE — combine conditions, filter by Definer, by Created date, etc.

Example 3 — Find by Name Pattern with LIKE

Use LIKE to find procedures whose name matches a pattern:

MySQL — Pattern match
SHOW PROCEDURE STATUS LIKE '%emp%';
OUTPUT
mysql — like emp
mysql>SHOW PROCEDURE STATUS LIKE '%emp%';
+---------+--------------+-----------+----------------+----------+---------------+----------------------+
| Db | Name | Type | Definer | ... | Security_type | Comment |
+---------+--------------+-----------+----------------+----------+---------------+----------------------+
| gowtham | emp | PROCEDURE | root@localhost | ... | DEFINER | Get employees |
| gowtham | GetEmployees | PROCEDURE | root@localhost | ... | DEFINER | Get all employees |
| gowtham | GetTotalEmp | PROCEDURE | root@localhost | ... | DEFINER | |
+---------+--------------+-----------+----------------+----------+---------------+----------------------+
3 rows in set (0.01 sec)
📌 The LIKE pattern matches against the Name column. The standard SQL wildcards apply: % matches zero or more characters, _ matches exactly one. So '%emp%' finds names containing "emp" anywhere; 'emp_' would find 4-letter names starting with "emp".

The information_schema database is MySQL's built-in metadata catalog. The ROUTINES table contains one row per stored procedure or function across all databases. Querying it programmatically is more powerful than SHOW PROCEDURE STATUS — you can join, filter, sort, and project arbitrary columns.

Example 4 — Procedures in One Database

Find every procedure (not function) in the gowtham database:

MySQL — information_schema query
SELECT routine_name
FROM   information_schema.ROUTINES
WHERE  routine_type   = 'PROCEDURE'
  AND  routine_schema = 'gowtham';
OUTPUT
mysql — information_schema
mysql>SELECT routine_name FROM information_schema.ROUTINES WHERE ...;
+--------------+
| ROUTINE_NAME |
+--------------+
| emp |
| GetEmployees |
| GetTotalEmp |
+--------------+
3 rows in set (0.00 sec)
⚠️ The original tutorial's information_schema query was broken. It read:
SELECT routine_name FROM routine_name
WHERE routine_name='PROCEDURE'
  AND routine_name='gowtham'
The table is information_schema.ROUTINES (not routine_name), and the conditions need routine_type for the kind and routine_schema for the database. The fixed version above is what actually works.
Example 5 — More Useful Columns

The full ROUTINES table has dozens of columns. A practical query selecting the most useful ones:

MySQL — Detailed routine info
SELECT routine_schema   AS db,
       routine_name     AS name,
       routine_type     AS type,
       data_access      AS sql_data_access,
       security_type,
       definer,
       created,
       last_altered,
       routine_comment  AS comment
FROM   information_schema.ROUTINES
WHERE  routine_schema = 'gowtham'
ORDER  BY routine_name;
Example 6 — See the Full Source Code

The routine_definition column contains the procedure body itself:

MySQL — Show source
SELECT routine_name, routine_definition
FROM   information_schema.ROUTINES
WHERE  routine_type   = 'PROCEDURE'
  AND  routine_schema = 'gowtham'
  AND  routine_name   = 'GetTotalEmp'\G
OUTPUT
mysql — routine_definition
mysql>SELECT routine_name, routine_definition FROM information_schema.ROUTINES ... \G
*************************** 1. row ***************************
routine_name: GetTotalEmp
routine_definition: BEGIN
DECLARE total_emp INT DEFAULT 0;
SELECT COUNT(*) INTO total_emp
FROM employees
WHERE salary >= 17000;
SELECT total_emp;
END
1 row in set (0.00 sec)
💡 Note that routine_definition contains only the body between BEGIN and END — not the full CREATE PROCEDURE statement, parameter list, or characteristics. For the full creation statement, use SHOW CREATE PROCEDURE name.
Use SHOW PROCEDURE STATUS for…Use information_schema.ROUTINES for…
Quick interactive listingProgrammatic access from application code
The columns SHOW gives youJoins, complex filters, custom column ordering
Casual exploration in mysql CLIBuilding reports across many databases
Same syntax across MySQL versionsIncluding the procedure body in the result

For visual exploration, MySQL Workbench is the easiest route:

  1. Open the schema panel on the left.
  2. Expand the database you're interested in.
  3. Expand the Stored Procedures node — every procedure in that database is listed.
  4. Right-click any procedure for options: alter, drop, view definition, copy to clipboard.

DBeaver, HeidiSQL, and other GUI clients have similar trees. They all read from information_schema under the hood.

  1. Start with SHOW PROCEDURE STATUS for ad-hoc browsing — fastest to type and gives the most-needed columns.
  2. Reach for information_schema.ROUTINES when you need joins, custom output, or programmatic access.
  3. Always filter by routine_schema when querying ROUTINES — without it, you'll get every procedure on the server, including system schemas.
  4. Specify routine_type too — the same table holds both procedures and functions.
  5. Use SHOW CREATE PROCEDURE name\G when you need the full DDL with parameters and characteristics.
  • Three ways to find stored procedures: SHOW PROCEDURE STATUS, information_schema.ROUTINES, and GUI clients like MySQL Workbench.
  • SHOW PROCEDURE STATUS accepts LIKE 'pattern' for name matching and WHERE condition for arbitrary filtering.
  • information_schema.ROUTINES contains both procedures and functions — always filter by routine_type = 'PROCEDURE' and routine_schema = 'your_db'.
  • The routine_definition column holds just the body between BEGIN and END; use SHOW CREATE PROCEDURE name\G for the complete CREATE statement.
  • For multi-database scripting, querying information_schema.ROUTINES is more flexible than SHOW PROCEDURE STATUS.