新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
實現(xiàn)MySQL定時執(zhí)行并不難!
以下的文章主要向大家描述的是MySQL定時執(zhí)行的實際操作步驟,以及在MySQL定時執(zhí)行的實際操作過程中值得我們大家注意的幾點的描述,如果你對其相關(guān)的實際操作有興趣了解的話,你就瀏覽以下的文章了。

查看event是否開啟
- show variables like '%sche%';
將事件計劃開啟
- set global event_scheduler =1;
創(chuàng)建存儲過程test
- CREATE PROCEDURE test ()
- BEGIN
- update examinfo SET endtime = now() WHERE id = 14;
- END;
創(chuàng)建event e_test
- create event if not exists e_test
- on schedule every 30 second
- on completion preserve
- do call test();
每隔30秒將執(zhí)行存儲過程test,將當(dāng)前時間更新到examinfo表中id=14的記錄的endtime字段中去.
關(guān)閉事件任務(wù)
- alter event e_test ON
- COMPLETION PRESERVE DISABLE;
開戶事件任務(wù)
- alter event e_test ON
- COMPLETION PRESERVE ENABLE;
以上測試均成功,測試環(huán)境為mysql 5.4.2-beta-community mysql community server(GPL)
以上的相關(guān)內(nèi)容就是對MySQL定時執(zhí)行的介紹,望你能有所收獲。
上述的相關(guān)內(nèi)容就是對MySQL定時執(zhí)行的描述,希望會給你帶來一些幫助在此方面。
文章名稱:實現(xiàn)MySQL定時執(zhí)行并不難!
URL鏈接:http://www.fisionsoft.com.cn/article/cdegdce.html


咨詢
建站咨詢
