Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.