List stored procedures and functions in MySQL database

Knowledge-base/Databases-queries/MySQL queries

Mars 07th, 2023

[wp_social_sharing social_options='facebook,twitter,linkedin,pinterest,reddit' twitter_username='softbuilder1' facebook_text='Share on Facebook' twitter_text='Share on Twitter' linkedin_text='Share on Linkedin' pinterest_text="Share on Pinterest" reddit_text="Share on Reddit" icon_order='f,t,l,p,x,r' show_icons='2' before_button_text='' text_position='' social_image='']

 

In this article, we will show you how to list stored procedures and functions in a MySQL database.

1. Using SQL Query

The following SQL script should return a list of all stored procedures and functions of the MySQL database.

SELECT  routine_schema,  
        routine_name,  
        routine_type 
FROM information_schema.routines 
WHERE routine_schema = 'your_database_name' 
ORDER BY routine_name;

Sample results
The result of the given query will list stored procedures and functions in the MySQL database:

list stored procedures and functions in MySQL database

2. Using MySQL interactive shell command-line

If you are using the MySQL shell command line you can list all procedures in the MySQL database with the SHOW PROCEDURE STATUS WHERE db = 'your_database_name'; command.

The output of the show procedure command will be:

list procedures in MySQL database using MySQL shell

Listing all functions in a MySQL database can be done using SHOW FUNCTION STATUS WHERE db = 'your_database_name'; command.

The output of the command:

list functions in MySQL database using MySQL shell

3. List stored procedures and functions with ERBuilder Data Modeler

ERBuilder Data Modeler allows you to visualize the structure of your MySQL database as well as the visualization for the list of all stored procedures and functions in your database.

For more details such as the stored procedure statement or the function statement ERBuilder Data Modeler allows you to visualize that just by double-clicking on the procedure name or the function name, furthermore, it allows you to edit it delete it, or add new functions or procedures.

Start modeling your database with us today

Subscribe To Our Newsletter

Subscribe to our email newsletter today to receive updates of the latest news, tutorials and special offers!

Share on:

[wp_social_sharing social_options='facebook,twitter,linkedin,pinterest,reddit' twitter_username='softbuilder1' facebook_text='Share on Facebook' twitter_text='Share on Twitter' linkedin_text='Share on Linkedin' pinterest_text="Share on Pinterest" reddit_text="Share on Reddit" icon_order='f,t,l,p,x,r' show_icons='2' before_button_text='' text_position='' social_image='']

Request a quote

Please enable JavaScript in your browser to complete this form.
Address

Choose a product

Choose a product and get 15 Day fully-functional free trial. No credit card required
Standard support Premium support
Support channel Email support
  • Email support
  • Live meeting
Individual Onboarding training Training is not included in the offer
  • Premium training included
  • Up to 8 online sessions, 90 minutes each
Review meetings Once a year Twice a year
Dedicated Account Manager No Yes
Book a quick demo NOW Book a quick demo NOW