事件在mysql中无法正常工作? [英] event is not working properly in mysql?

查看:88
本文介绍了事件在mysql中无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个活动来执行每月的第一天.

I have created an event to execute first day of every month.

事件如下:

DELIMITER $$
CREATE EVENT event2
ON SCHEDULE EVERY '1' MONTH
STARTS '2011-05-01 00:00:00'
DO
BEGIN
 call UpdateIt();
END$$

DELIMITER ;

/* Here Stored procedure "UpdateIt()" will update a row.*/

存储过程没有问题,可以正常工作.

No Issue with the Stored procedure, its working fine.

我将@@ global.event_scheduler设置为1.

And I have set the @@global.event_scheduler to 1.

即使它不起作用.请问有人能解决这个问题吗?

Even though it is not working. Could any one sort out this issue, please.

推荐答案

1-按照问题所述创建事件.

1- Create the event as stated in the question.

2-将系统日期更改为'2011-04-30 23:58:00'

2- Change the system date to '2011-04-30 23:58:00'

3-重新启动MySQL

3- Restart MySQL

如果您更改系统日期,则需要重新启动MySQL,否则它将无法检测到更改.
还要注意,如果您与时间服务器进行某种时间同步,则需要将其禁用,否则您的服务器将恢复为实时,直到MySQL有机会完成重启.

MySQL needs to be restarted if you change the system date, or it will not detect the change.
Also note that if you have some sort of time-synchronization with a time-server you need to disable that or your server will revert to the real time before MySQL has a chance to finish the restart.

这篇关于事件在mysql中无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆