1711
MySQLERRORNotableTriggersHIGH confidence

Referenced trigger does not exist

Production Risk

Low — trigger creation fails; no data affected.

What this means

A CREATE TRIGGER statement with a FOLLOWS or PRECEDES clause referenced a trigger that does not exist on the table.

Why it happens
  1. 1The trigger named in FOLLOWS or PRECEDES was already dropped or was never created.
  2. 2Typo in the referenced trigger name.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TRIGGER t_new AFTER INSERT ON t FOR EACH ROW FOLLOWS nonexistent_trigger
BEGIN END;

expected output

ERROR 1711 (HY000): Referenced trigger 'nonexistent_trigger' for the given table does not exist.

Fix

Verify the referenced trigger exists before creating the new trigger

Verify the referenced trigger exists before creating the new trigger
SHOW TRIGGERS FROM mydb LIKE 'nonexistent_trigger';
-- If missing, create it first or remove the FOLLOWS/PRECEDES clause.

Why this works

Checking trigger existence before referencing it avoids this error.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1711 ER_REFERENCED_TRG_DOES_NOT_EXIST

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

← All MySQL errors