mysql檢視所有觸發器以及儲存過程等操作集合
阿新 • • 發佈:2018-12-25
1. mysql查詢所有表:
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '資料庫名' AND TABLE_TYPE ='BASE TABLE'
mysql查詢建表語句:
show create table `表名`
2.mysql查詢所有檢視:
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '資料庫名' AND TABLE_TYPE ='VIEW'
mysql查詢檢視建立語句:
show create view `檢視名`
3.mysql查詢所有函式:
SELECT name from mysql.proc where db= 'ifms' and type='function'
mysql查詢函式定義語句:
SHOW CREATE FUNCTION `函式名`
4.mysql查詢所有儲存過程:
SELECT name from mysql.proc where db= 'ifms' and type='procedure'
mysql查詢procedure定義語句:
SHOW CREATE procedure `儲存過程名`
5.mysql查詢所有觸發器:
SELECT * FROM information_schema.`TRIGGERS`
mysql查詢觸發器定義語句:
select * from information_schema.triggers where TRIGGER_NAME='觸發器名';