方法一:
select `name` from mysql.proc where db = 'your_db_name' and `type` = 'PROCEDURE' //存儲過程
select `name` from mysql.proc where db = 'your_db_name' and `type` = 'FUNCTION' //函數
方法二:
show procedure status; //存儲過程
SHOW PROCEDURE STATUS WHERE db='servant_591up'
show function status; //函數
查看存儲過程或函數的創建代碼
show create procedure proc_name;
show create function func_name;
查看視圖
SELECT * from information_schema.VIEWS //視圖
SELECT * from information_schema.TABLES //表
查看觸發器
方法一:
語法:SHOW TRIGGERS [FROM db_name] [LIKE expr]
實例:SHOW TRIGGERS\G //觸發器
方法二:
對INFORMATION_SCHEMA數據庫中的TRIGGERS表查詢
mysql>SELECT * FROM triggers T WHERE trigger_name=”mytrigger” \G