MySQL Event Not Working – Troubleshooting Guide

innodbmyisamMySQLmysql-event

I have a working command:

UPDATE ads SET ad_points = ad_points - 20

And I would like to perform this action every day.

After creating the event in phpMyAdmin (MYSQL) nothing happens (on the next day, etc.):

CREATE EVENT daily_pointsmin
    ON SCHEDULE
      EVERY 1 DAY
    COMMENT 'Subtracts twenty points from all the ads on every day.'
    DO
      UPDATE ads SET ad_points = ad_points - 20;

What can be the reason? The DB is in MYISAM, the tables are in InnoDB.

I've tried this already (including db in code):

UPDATE indikatr_main.ads SET ad_points = ad_points - 20

Best Answer

To enable or disable the execution of scheduled events, it is necessary to set the value of the global event_scheduler system variable. This requires the SYSTEM_VARIABLES_ADMIN or SUPER privilege. link

GRANT EVENT ON myschema.* TO jon@ghidora;

Or you may need to add super privilege using phpmyadmin link

Go to PHPMYADMIN > privileges > Edit User > Under Administrator tab Click SUPER > Go