The Power of a simple SET…

Recently, I installed a new local MySQL Server with the purpose to log debug messages.

But because I had to log a lot of messages disk space became an issue. So I decided to create an event to clear these messages hourly. 

I spent a lot of time trying to understand why the code worked fine in a single execution, but when the same code was inside the event it was not working when the schedule was met. 

After some reasearch I found out that by default event_scheduler global variable is OFF. 

After enabling it, the event started to work.

You just need to execute the line:

SET GLOBAL event_scheduler = ON;



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s