- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can we create a MySQL recurring event that executes after a specified time period and ends after a specified time period?
As we know that recurring event means that it will be executed after regular time of interval and expires at the specified time. To illustrate the creation of such kind of events we are using the following example in which we are creating an event which will execute after every minute and expires after one hour −
mysql> CREATE EVENT testing_event10 ON SCHEDULE EVERY 1 MINUTE STARTS CURRENT_TIMESTAMP ENDS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT INTO event_message(message,generated_at) Values('Recrring evnts',NOW()); Query OK, 0 rows affected (0.00 sec) mysql> Select * from event_message; +----+----------------+---------------------+ | ID | MESSAGE | Generated_at | +----+----------------+---------------------+ | 1 | Hello | 2017-11-22 17:05:22 | | 2 | Hi | 2017-11-22 17:08:37 | | 3 | Recrring evnts | 2017-11-22 20:14:00 | | 4 | Recrring evnts | 2017-11-22 20:15:00 | | 5 | Recrring evnts | 2017-11-22 20:16:00 | | 6 | Recrring evnts | 2017-11-22 20:17:00 | | 7 | Recrring evnts | 2017-11-22 20:18:00 | | 8 | Recrring evnts | 2017-11-22 20:19:00 | +----+----------------+---------------------+ 8 rows in set (0.00 sec)
- Related Articles
- How can we create a MySQL one-time event that executes after some specified time interval?
- How can we create a MySQL one-time event that executes immediately?
- In MySQL, how can we display time in other format specified by the user?
- How can we create multiple MySQL triggers for the same trigger event and action time?
- A pendulum oscilliates 18 time in 4 seconds find its time period. And frequency
- How can we retrieve the length of a specified string in MySQL?
- How to get a part of string after a specified character in JavaScript?
- How to Add Period After Numbers List in Excel?
- In MySQL, how can we insert a substring at the specified position in a string?
- Define amplitude, time period, and frequency of sound wave.
- How to make a setInterval() stop after some time or after a number of actions in JavaScript?
- Set the milliseconds for a specified date according to universal time.
- Set the seconds for a specified date according to universal time.
- Set the minutes for a specified date according to universal time.
- Set the month for a specified date according to universal time.

Advertisements