1.查詢數據庫中的存儲過程和函數 方法一: 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 function status; //函數
查看存儲過程或函數的創建代碼 show create procedure proc_name; show create function func_name;
2.查看視圖 SELECT * from information_schema.VIEWS //視圖 SELECT * from information_schema.TABLES //表
3.查看觸發器 方法一: 語法:SHOW TRIGGERS [FROM db_name] [LIKE expr] 實例:SHOW TRIGGERS\G //觸發器 方法二: 對INFORMATION_SCHEMA數據庫中的TRIGGERS表查詢 mysql>SELECT * FROM triggers T WHERE trigger_name=”mytrigger” \G