I have created mysql to delete table rows, which have lower DATETIME value than NOW(), SHOW PROCESSLIST shows event and time counter is running but it dont delete rows. Here is the code:
CREATE EVENT minute_event
ON SCHEDULE EVERY 1 minute
DO
DELETE FROM reservations WHERE 'reservation_end' < NOW();
You’re using single quotes instead of backticks. The expression
'reservation_end' < NOW()should cause a MySQL Error #1267, because'reservation_end'is just a string. It should be:or unquoted since
reservation_enddoesn’t specifically need to be surrounded by backticks.