There are three things you should do with this
- Change
DROP DATABASE to DROP DATABASE IF EXISTS
- Add
INTERVAL 11 HOUR to the START (as mentioned by @ypercube)
- Add
ON COMPLETION PRESERVE to make it a repeatable event so you don't have to create it again.
Here are the changes
DELIMITER $$
CREATE EVENT le_drop_database
ON SCHEDULE
EVERY 1 WEEK
STARTS CURRENT_DATE + INTERVAL 3 - WEEKDAY(CURRENT_DATE) DAY + INTERVAL 11 HOUR DO
ON COMPLETION PRESERVE
BEGIN
DROP DATABASE IF EXISTS carbon;
END $$
DELIMITER ;
I hope this event is not in the carbon database
If you ever need to disable the event, just run
ALTER EVENT le_drop_database DISABLE;
to reenable
ALTER EVENT le_drop_database ENABLE;
CAVEAT
Please make sure you have this in my.cnf
[mysqld]
event_scheduler=1
You can enable this without restarting mysql by running
mysql> SET GLOBAL event_scheduler = 1;
Give it a Try !!!