mysql view all stored procedures, functions, views, triggers, table

2011-05-27  来源:本站原创  分类:Database  人气:86 

Query the database stored procedures and functions

Method One:

select `name` from mysql.proc where db = 'your_db_name' and `type` = 'PROCEDURE'   // Stored procedure
       select `name` from mysql.proc where db = 'your_db_name' and `type` = 'FUNCTION'   // Function

Method Two:

show procedure status; // Stored procedure 

        show function status;     // Function

View the creation of a stored procedure or function code

show create procedure proc_name;
show create function func_name;

View view

SELECT * from information_schema.VIEWS   // View 

SELECT * from information_schema.TABLES   // Table

View Trigger

Method One:

Syntax :SHOW TRIGGERS [FROM db_name] [LIKE expr]
 Instance :SHOW TRIGGERS\G     // Trigger

Method Two:
INFORMATION_SCHEMA TRIGGERS on the table in the database query

mysql>SELECT * FROM triggers T WHERE trigger_name="mytrigger" \G