1.查詢數(shù)據(jù)庫中的存儲(chǔ)過程和函數(shù)
方法一:
select `name` from MySQL.proc where db = 'your_db_name' and `type` = 'PROCEDURE' //存儲(chǔ)過程
select `name` from mysql.proc where db = 'your_db_name' and `type` = 'FUNCTION' //函數(shù)
方法二:
show procedure status; //存儲(chǔ)過程
show function status; //函數(shù)
查看存儲(chǔ)過程或函數(shù)的創(chuàng)建代碼
show create procedure proc_name;
show create function func_name;
2.查看視圖
SELECT * from information_schema.VIEWS //視圖
SELECT * from information_schema.TABLES //表
3.查看觸發(fā)器
方法一:
語法:SHOW TRIGGERS [FROM db_name] [LIKE expr]
實(shí)例:SHOW TRIGGERS\G //觸發(fā)器
方法二:
對(duì)INFORMATION_SCHEMA數(shù)據(jù)庫中的TRIGGERS表查詢
mysql>SELECT * FROM triggers T WHERE trigger_name=”mytrigger” \G
當(dāng)前題目:MySQL查看存儲(chǔ)過程和函數(shù)、視圖和觸發(fā)器
瀏覽路徑:
http://weahome.cn/article/pghpid.html