简体   繁体   English

phpMyAdmin:如何安排存储过程?

[英]phpMyAdmin: How do I schedule my stored procedure?

Using: phpMyAdmin 4.0.10.7 使用: phpMyAdmin 4.0.10.7

Goal: Schedule my stored procedure to run ever night (for testing purposes, I have it set to run every 1 minute) 目标:计划存储过程每晚运行(出于测试目的,我将其设置为每1分钟运行一次)

Problem: I feel like I have it scheduled correctly, but I know it is not because part of my sproc (in testing) is to create a 'test' tbl, but I do not see the tbl being created 问题:感觉自己已正确安排了时间,但是我知道这不是因为我的存储过程(正在测试中)的一部分是创建“测试” tbl,但是我看不到正在创建tbl

What I Know: I know the sproc is written correctly because I can manually run it, and it manually runs successfully 我所知道的:我知道sproc是正确编写的,因为我可以手动运行它,并且可以成功手动运行

What I Have Tried: I have tried to set this up using the settings in the screenshots below 我尝试过的方法:我尝试使用下面的屏幕快照中的设置进行设置

Could anyone please inform me of why my sproc is not running on schedule? 有人可以告诉我为什么我的存储程序未按计划运行吗?

sproc: 存储过程: 在此处输入图片说明

Event (Schedule): 活动(时间表): 在此处输入图片说明

`CREATE EVENT Event_Name
ON SCHEDULE EVERY 1 DAY
STARTS '2016-03-27 00:00:00'
DO CALL sproc_operations()`

will be the query. 将是查询。 Even if it doesn't insert the data in your expected test table then try calling the stored procedure manually and check whether the stored procedure have some issue. 即使它没有在预期的测试表中插入数据,也请尝试手动调用存储过程,并检查存储过程是否存在问题。

Do check whether the user is allowed to create event or not by checking Privileges. 通过检查权限来检查是否允许用户创建事件。 Refer Checking and Granting Privileges 请参阅检查和授予特权

Most likely your Event Scheduler is off. 您的事件计划程序很可能已关闭。 Turn it on as follows: 如下打开它:

SET GLOBAL event_scheduler = ON;

https://dev.mysql.com/doc/refman/5.7/en/events-configuration.html https://dev.mysql.com/doc/refman/5.7/en/events-configuration.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM