I have added the following simple test event on my mysql database via phpmyadmin:
CREATE DEFINER=`root`@`localhost` EVENT `my_event` ON SCHEDULE EVERY 1 MINUTE STARTS '2013-05-27 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN UPDATE `test` SET `name`="z"; END
My environment is mac + MAMP Pro. I am expecting to change all rows on my 'test' table with name 'z' within a minute. But not happening so.
Do I have to something additional to get my events start working?
Output of "SHOW PROCESSLIST":
Thanks.
To enable the Event Scheduler, restart the server without the --event-scheduler=DISABLED command-line option, or after removing or commenting out the line containing event-scheduler=DISABLED in the server configuration file, as appropriate.
SELECT * FROM INFORMATION_SCHEMA. events; You can also use SHOW CREATE EVENT yourevent to see what it does.
Syntax. DROP EVENT event_name; Where, event_name is the name of the event you need to delete.
To rename an event, use the ALTER EVENT statement's RENAME TO clause. This statement renames the event myevent to yourevent : ALTER EVENT myevent RENAME TO yourevent; You can also move an event to a different database using ALTER EVENT ...
Events are run by the scheduler, which is not started by default. Using SHOW PROCESSLIST
is possible to check whether it is started. If not, run the command
SET GLOBAL event_scheduler = ON;
to run it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With