1553
MariaDBERRORNotableEventsHIGH confidence

Event must define a schedule or execute-at time

Production Risk

Low — DDL error; the event will not be created.

What this means

ER_EVENT_NEITHER_M_EXPR_NOR_M_AT (1553, SQLSTATE HY000) is raised when CREATE EVENT or ALTER EVENT is specified without a valid ON SCHEDULE clause.

Why it happens
  1. 1Omitting the ON SCHEDULE clause from CREATE EVENT
  2. 2ALTER EVENT that removes the schedule without providing a new one
How to reproduce
trigger — this will error
trigger — this will error
CREATE EVENT my_event DO SELECT 1;  -- Missing ON SCHEDULE

expected output

ERROR 1553 (HY000): You must define either a SCHEDULE or a AT clause for the event

Fix

Add a valid ON SCHEDULE clause

Add a valid ON SCHEDULE clause
-- Recurring event:
CREATE EVENT my_event
ON SCHEDULE EVERY 1 HOUR
DO SELECT 1;

-- One-time event:
CREATE EVENT my_event
ON SCHEDULE AT NOW() + INTERVAL 1 DAY
DO SELECT 1;

Why this works

Every event must have an ON SCHEDULE clause specifying either EVERY or AT.

Sources
Official documentation ↗

MySQL 8.0 — 1553 ER_EVENT_NEITHER_M_EXPR_NOR_M_AT

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors