Questions regarding Events mysql

Asked

Viewed 41 times

2

I created an event in a database Mysql, I noticed when I restarted the bank localhost, the event returns offline, someone knows if it is like that or if you have to execute a command whenever the database is started or if you are in a hosting the bank already executes the command after the bank is restarted in case of a fall or maintenance account?

Code used to start the event:

SET GLOBAL event_scheduler = ON;

Event code:

CREATE EVENT `limpeza`
ON SCHEDULE
    EVERY 1 MINUTE STARTS CURRENT_TIMESTAMP() 
ON COMPLETION PRESERVE
ENABLE
DO
insert into pessoa (nome) SELECT CONCAT_WS(":",CURRENT_DATE(),EXTRACT(HOUR FROM CURRENT_TIME()))

1 answer

0

You can define

event_scheduler=ON

in my.ini or my.cnf file , restart the server for configuration to take effect.

Once set, event_scheduler will always remain ON no matter if your server is restarted.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.