Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set a MySQL event schedule using phpMyAdmin?

I want to increment a field on the first minute of every day, and then once it hits a certain value, set the value to 1. I would like to do this directly in MySQL, but preferably through phpMyAdmin.

I am aware of the Event Scheduler, and so I'm looking for a way to use and manage it through phpMyAdmin. Is this possible?

like image 499
Lars Avatar asked Jul 08 '11 09:07

Lars


People also ask

How do I create a scheduled event in MySQL?

Assuming you have MySQL rights to create events, the basic syntax is: CREATE EVENT `event_name` ON SCHEDULE schedule [ON COMPLETION [NOT] PRESERVE] [ENABLE | DISABLE | DISABLE ON SLAVE] DO BEGIN -- event body END; The schedule can be assigned various settings, e.g.

Does MySQL have a scheduler?

The MySQL Event Scheduler manages the scheduling and execution of events, that is, tasks that run according to a schedule.

What is event in phpMyAdmin?

trigger are fired on data change. and events are fired on behalf of minutes,hour,days,date. Let me try to explain you with example, you are creating a 50% off offer on a product And you have to expire this offer after 50 Minutes or sunday at 1pm. In this case event scheduler is used.


1 Answers

It is.. Just issue appropriate CREATE EVENT SQL from SQL box.

However: your MySQL server needs to have event scheduler enabled AND have EVENT privileges for the database user.

Calling SELECT @@event_scheduler; will tell you if the scheduler is available and enabled.

To enable event scheduler if it's disabled try calling SET GLOBAL event_scheduler := 1; You need the SUPER privilege for this to succeed.

like image 61
Mchl Avatar answered Oct 12 '22 13:10

Mchl