How to create event in MySQL Workbench

Mehrnoosh picture Mehrnoosh · May 19, 2016 · Viewed 8.1k times · Source

I have problem with creating trigger in MySQL workbench. I read this post working with triggers and found there isn't any event part in UI interface of workbench but we can write event SQL query in work branch.

I wrote it and run it but it doesn't run. also when I run show events; there is not any events in the list.

SET GLOBAL event_scheduler = ON;
delimiter |
CREATE EVENT `TestEvent` 
ON SCHEDULE EVERY 1 day

DO BEGIN
insert into test2 (id, source, name)
select id, source, name from test1
END 

delimiter ;

How can I solve it?

Answer