Common SQL Errors

MySQL Error 1360 ER_TRG_DOES_NOT_EXIST: Trigger does not exist - How to Fix and Prevent

Galaxy Team
August 6, 2025

<p>Error 1360 indicates that a referenced trigger name cannot be found in the current MySQL schema.</p>

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 1360 ER_TRG_DOES_NOT_EXIST?

<p>MySQL Error 1360: ER_TRG_DOES_NOT_EXIST appears when a SQL statement refers to a trigger that is missing or was never created. Verify the trigger name and schema, then recreate or drop all references to resolve the issue.</p>

Error Highlights

Typical Error Message

Trigger does not exist

Error Type

Object Reference Error

Language

MySQL

Symbol

ER_TRG_DOES_NOT_EXIST

Error Code

1360

SQL State

HY000

Explanation

Table of Contents

What does MySQL Error 1360 ER_TRG_DOES_NOT_EXIST mean?

The server raises ER_TRG_DOES_NOT_EXIST when a statement tries to alter, drop, or fire a trigger that the data dictionary cannot locate. The trigger may have been deleted, created in another schema, or never defined.

The error stops the current transaction because MySQL cannot execute operations tied to an unknown trigger. Fixing it quickly restores data integrity and application stability.

When does this error usually occur?

Developers see the error during ALTER TABLE, DROP TRIGGER, or INSERT/UPDATE actions that should invoke a missing BEFORE or AFTER trigger. It also appears in mysqldump restores if triggers were skipped.

CICD pipelines often surface the error while replaying migrations on new environments where the trigger script was not applied.

Why is resolving it important?

Missing triggers break business rules enforced at the database layer, causing silent data corruption. Eliminating the error ensures validation, auditing, and cascading logic run reliably.

Continuous integration workflows fail fast on this error, blocking deployments until the trigger definition is restored or dependencies are removed.

Common Causes

Misspelled trigger name

A simple typo in DROP TRIGGER or ALTER TABLE ... DROP/ADD TRIGGER statements leads MySQL to search for a non-existent trigger.

Incorrect database selected

Executing trigger operations in the wrong schema makes valid trigger names invisible because MySQL looks only in the current database.

Missing migration step

Deploying to staging or production without the CREATE TRIGGER script means later migrations reference a trigger that was never created.

Manual deletion

An admin may have dropped the trigger to troubleshoot, forgetting to recreate it, leaving dependent code broken.

mysqldump restore without --triggers

Restoring data only imports tables. Without the --triggers flag, trigger objects are skipped, so applications referencing them fail.

Related Errors

MySQL Error 1146: ER_NO_SUCH_TABLE

Occurs when a referenced table is missing. Similar root cause: object does not exist.

MySQL Error 1215: Cannot add foreign key constraint

Triggered by missing parent tables or mismatched data types during constraint creation.

MySQL Error 1305: ER_SP_DOES_NOT_EXIST

Raised when calling a stored procedure that is absent, paralleling the missing trigger scenario.

FAQs

Does dropping a table automatically drop its triggers?

Yes. MySQL removes all triggers tied to a table when that table is dropped, which can later cause ER_TRG_DOES_NOT_EXIST if migrations assume the trigger persists.

How can Galaxy help prevent this error?

Galaxy tracks and versions SQL migrations, letting teams confirm CREATE TRIGGER scripts run in every environment. Its AI copilot flags missing trigger references during code review.

Is there a way to suppress the error temporarily?

No. MySQL stops the operation when the trigger is missing. You must recreate the trigger or remove the reference to continue.

Which MySQL versions raise this error?

All supported MySQL versions, including 5.7, 8.0, and MariaDB forks, emit error 1360 when a trigger is not found.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo