How to Create Event in MYSQL?

Asked

Viewed 923 times

3

I’m learning now about create Event in mysql

I’m creating a simple test Event, but it’s not working, it appears in Events, but the table is not updated:

CREATE EVENT teste
    ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 10 SECOND
    DO
      UPDATE euk_teste SET status=2 WHERE id_produto=1;

Is something missing? Need to enable something?

1 answer

2

Syntax is correct. Probably the scheduling service is stopped.

Query to check service status:

SELECT @@EVENT_SCHEDULER;

inserir a descrição da imagem aqui

Activating the service:

SET GLOBAL event_scheduler = ON;

Browser other questions tagged

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