mysql檢視所有觸發器以及儲存過程等操作集合

2022-05-17 01:11:18 字數 1288 閱讀 3153

今天在做每個月定時扣費的功能 用到了mysql的event scheduler

昨完之後發現乙個問題 event scheduler 預設是不開啟的 要在mysql內執行set global event_scheduler=on;

重啟服務之後 測試發現 事件還是未被呼叫 ,

然後在執行show variables like 'event_scheduler'; 檢視,驚奇的發現 重啟之後 event_scheduler 又被置為off了

最後只能在my.conf檔案內加一行set global event_scheduler=on; 這樣隨著mysql服務的開啟  event scheduler也會自動開啟

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='觸發器名';

my sql 觸發器 MySQL檢視觸發器

檢視觸發器是指檢視資料庫中已經存在的觸發器的定義 狀態和語法資訊等。mysql 中檢視觸發器的方法包括 show triggers 語句和查詢 information schema 資料庫下的 triggers 資料表等。本節將詳細介紹這兩種檢視觸發器的方法。show triggers語句檢視觸發器...

mysql檢視所有觸發器以及儲存過程等操作集合

mysql 檢視所有觸發器以及儲存過程等操作集合 今天在做每個月定時扣費的功能 用到了mysql 的event scheduler 昨完之後發現乙個問題 event scheduler 預設是不開啟的 要在mysql 內執行set global event scheduler on 重啟服務之後 測...

mysql檢視所有觸發器以及儲存過程等操作集合

1.mysql查詢所有表 select table name from information schema.tables where table schema 資料庫名 and table type base table mysql查詢建表語句 show create table 表名 2.mys...