Starting with MySQL Events

  • Avinash
  • 4
  • Jan 11, 2012
  • Database

Today I am going to start the series of the articles. This series is about Basics of MySQL Events, Creating and Altering the Events, Managing the Events and all that. This article is about to cover Basics of MySQL Events.

What Is MySQL Events?

MySQL Events are just like an bunch of queries which we can execute on specific time. We can define this time while creating the Events in MySQL. Before you create an Events in MySQL you must have that enabled :).

Enable MySQL Events

Before directly enabling the MySQL Events let’s check the current status of your MySQL Server for Events. For this open your MySQL Qurery Browser and run below query.

SHOW VARIABLES LIKE "EVENT_SCHEDULER";
  SHOW VARIABLES LIKE "EVENT_SCHEDULER";

If above query returns the value ON in front of ‘EVENT_SCHEDULER’, then you are good to skip the below steps. But if you get the result OFF then you must have to follow below steps in order to enable MySQL Events.

For enabling the MySQL Events execute below query in your Query Browser.

SET GLOBAL event_scheduler=ON;
  SET GLOBAL event_scheduler=ON;

Now to make sure you have enabled the MySQL events, you can again execute SHOW VARIABLES LIKE 'EVENT_SCHEDULER';. If you now got the value ON then you have successfuly enabled MySQL Events in your server.

Another way to make sure that Events are enabled or not if to execute below query.

SHOW PROCESSLIST;
  SHOW PROCESSLIST;

Upon executing above query if you got one row which have value “event_scheduler” in “User” fields then you have MySQL Events are enabled properly.

What’s Next?

In this article you come to know how to check the status of the Events in MySQL Server and also How to Enable Events in MySQL Server.
Next article would be about creating and managing the MySQL Events. So keep in touch. You can subscribe to our RSS Feed to to get updated via email.

Related Posts

Written by Avinash

Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.

View all posts by: