List stored procedures in MySQL
Posted in MySql - Last updated Oct. 05, 2011
This post shows how to get a complete list of stored procedures in a MySQL database and then to see what code is used in the stored procedure.
List MySQL stored procedures
Run the following SQL query either from the MySQL command line, or using a GUI tool like phpMyAdmin to get a complete list of stored procedures from all databases your login has access to:
To just list procedures from a particular database do this, where we want to query stored procedures from the "mydb_abc" database:
The output from the above commands will look something like this:
Show the SQL code in the stored procedure
Use the show create procedure query to get the SQL code from the query. To get it for the "mysproc" stored procedure in the example output above, do this:
This then gives you a few fields as a resultset and it's the "Create Procedure" column which has the procedure creation SQL.
'DB' 카테고리의 다른 글
MySQL 프로시져, 뷰 확인방법 (0) | 2018.05.05 |
---|---|
MySQL 기본 캐릭터 셋 설정하기 - RHEL/CentOS/Ubuntu (0) | 2018.05.05 |
두 날짜 사이의 날짜를 선택하는 SQL 쿼리sql (0) | 2018.04.26 |
PATH=$PATH:/usr/local/mysql/bin; (0) | 2018.04.19 |
SQL Database Performance Tuning for Developers (0) | 2018.04.10 |