سؤال

I created an event to run every 24 hours and be run at 14h. Its selects some data from tabels and writes it as to a file (csv format)

The query and writing to file goes ok. The event is triggered.

But (there is always a but) the event is triggered at different intervals.

It runs at 21h and 18h and sometimes at 0h. It seems it runs at will.

  • Am I doing something wrong?
  • Is there a setting I need to change?

this is the event

'def', 'x54_pro_dbo', 'export_timepro_to_genius', 'notes@%', 'SYSTEM', 'SQL', 'call     export_timepro_to_genius', 'RECURRING', NULL, '24', 'HOUR', 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION', '2012-01-26 14:00:00', '2036-01-26 00:00:00', 'ENABLED', 'PRESERVE', '2012-01-26 12:51:43', '2012-01-26 12:51:43', '2012-01-29 21:00:01', ' export timepro to genius', '0', 'utf8', 'utf8_general_ci', 'latin1_swedish_ci'

This is how I created the event

drop event if exists export_timepro_to_genius;
  CREATE EVENT IF NOT EXISTS  export_timepro_to_genius
   on  SCHEDULE EVERY 24 HOUR STARTS '2012-01-27 14:00:00'
   on completion preserve
   comment ' export timepro to genius'
 do  call export_timepro_to_genius  ;

I'm running mysql 5.5.6-rc

This is is from the .err log. So you can see that the query is runned at 14h and creates the file and then it is run again at 21h and gives an error because it cannot overwrite the file (witch is not the problem, the problem is that the event is triggerd at 21h)

120127 21:00:00 [ERROR] Event Scheduler: [notes@%][x54_pro_dbo.export_timepro_to_genius] File 'c:/tmp/TimePro20120127.csv' already exists
120127 21:00:00 [Note] Event Scheduler: [notes@%].[x54_pro_dbo.export_timepro_to_genius] event execution failed.
120127 21:07:14 [ERROR] Event Scheduler: [notes@%][x54_pro_dbo.export_timepro_to_genius] File 'c:/tmp/TimePro20120127.csv' already exists
120127 21:07:14 [Note] Event Scheduler: [notes@%].[x54_pro_dbo.export_timepro_to_genius] event execution failed.
120128 18:07:14 [ERROR] Event Scheduler: [notes@%][x54_pro_dbo.export_timepro_to_genius] File 'c:/tmp/TimePro20120128.csv' already exists
120128 18:07:14 [Note] Event Scheduler: [notes@%].[x54_pro_dbo.export_timepro_to_genius] event execution failed.
120128 21:00:00 [ERROR] Event Scheduler: [notes@%][x54_pro_dbo.export_timepro_to_genius] File 'c:/tmp/TimePro20120128.csv' already exists
120128 21:00:00 [Note] Event Scheduler: [notes@%].[x54_pro_dbo.export_timepro_to_genius] event execution failed.
120129 15:07:16 [ERROR] Event Scheduler: [notes@%][x54_pro_dbo.export_timepro_to_genius] File 'c:/tmp/TimePro20120129.csv' already exists
120129 15:07:16 [Note] Event Scheduler: [notes@%].[x54_pro_dbo.export_timepro_to_genius] event execution failed.
120129 21:00:01 [ERROR] Event Scheduler: [notes@%][x54_pro_dbo.export_timepro_to_genius] File 'c:/tmp/TimePro20120129.csv' already exists
120129 21:00:01 [Note] Event Scheduler: [notes@%].[x54_pro_dbo.export_timepro_to_genius] event execution failed
هل كانت مفيدة؟

المحلول

The first GA version of MySQL 5.5.8. You are using MySQL 5.5.6-rc

You need to get the latest version of MySQL 5.5

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى dba.stackexchange
scroll top