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:
| Tool | Best for |
|---|---|
SHOW PROCEDURE STATUS | Quick listing across all databases — name, type, definer, dates, comment |
information_schema.ROUTINES | Full-fidelity programmatic access — joinable, filterable, scriptable |
| MySQL Workbench / DBeaver | GUI browsing — expand the schema and click through |
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.
SHOW PROCEDURE STATUS;
To narrow the listing to procedures in one specific database, add a WHERE clause:
SHOW PROCEDURE STATUS WHERE Db = 'gowtham';
You can use any SQL boolean expression in WHERE — combine conditions, filter by Definer, by Created date, etc.
Use LIKE to find procedures whose name matches a pattern:
SHOW PROCEDURE STATUS LIKE '%emp%';
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.
Find every procedure (not function) in the gowtham database:
SELECT routine_name
FROM information_schema.ROUTINES
WHERE routine_type = 'PROCEDURE'
AND routine_schema = 'gowtham';
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.The full ROUTINES table has dozens of columns. A practical query selecting the most useful ones:
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;
The routine_definition column contains the procedure body itself:
SELECT routine_name, routine_definition
FROM information_schema.ROUTINES
WHERE routine_type = 'PROCEDURE'
AND routine_schema = 'gowtham'
AND routine_name = 'GetTotalEmp'\G
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 listing | Programmatic access from application code |
| The columns SHOW gives you | Joins, complex filters, custom column ordering |
Casual exploration in mysql CLI | Building reports across many databases |
| Same syntax across MySQL versions | Including the procedure body in the result |
For visual exploration, MySQL Workbench is the easiest route:
- Open the schema panel on the left.
- Expand the database you're interested in.
- Expand the Stored Procedures node — every procedure in that database is listed.
- 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.
- Start with
SHOW PROCEDURE STATUSfor ad-hoc browsing — fastest to type and gives the most-needed columns. - Reach for
information_schema.ROUTINESwhen you need joins, custom output, or programmatic access. - Always filter by
routine_schemawhen queryingROUTINES— without it, you'll get every procedure on the server, including system schemas. - Specify
routine_typetoo — the same table holds both procedures and functions. - Use
SHOW CREATE PROCEDURE name\Gwhen 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 STATUSacceptsLIKE 'pattern'for name matching andWHERE conditionfor arbitrary filtering.information_schema.ROUTINEScontains both procedures and functions — always filter byroutine_type = 'PROCEDURE'androutine_schema = 'your_db'.- The
routine_definitioncolumn holds just the body betweenBEGINandEND; useSHOW CREATE PROCEDURE name\Gfor the complete CREATE statement. - For multi-database scripting, querying
information_schema.ROUTINESis more flexible thanSHOW PROCEDURE STATUS.