<p>MySQL throws error 1359 (ER_TRG_ALREADY_EXISTS) when you try to create a trigger that already exists with the same timing and event on the target table.</p>
<p>MySQL Error 1359: ER_TRG_ALREADY_EXISTS means a trigger with the same name or the same timing-event pair already exists in the database. Drop or rename the existing trigger before creating a new one to resolve the issue.</p>
Trigger already exists
MySQL raises Error 1359 with the message "Trigger already exists" when a CREATE TRIGGER statement conflicts with an existing trigger definition.
The conflict can be by name or by the same combination of timing (BEFORE or AFTER) and event (INSERT, UPDATE, DELETE) on a given table.
The error appears if a trigger of the same name is already present in the current database.
MySQL also rejects multiple triggers for the same table with identical timing-event pairs, even when names differ.
Confirm whether the trigger truly exists with SHOW TRIGGERS and DROP it if no longer needed, then re-create your new trigger.
If both triggers are required, rename your new trigger or adjust timing/event so each pair is unique.
Schema migrations that re-apply CREATE TRIGGER statements often meet this error. Add IF NOT EXISTS logic around the DROP TRIGGER command.
Developers working in shared environments sometimes duplicate trigger names. Use naming conventions including table and action to avoid overlap.
Version-control DDL scripts and run idempotent migration steps that drop or check for existing triggers before creation.
Adopt descriptive trigger names and document timing-event pairs to keep the catalog clear.
Error 1235 sql_mode conflicts arise when a trigger statement violates restrictive server modes. Adjust sql_mode or rewrite the trigger.
Error 1146 table does not exist occurs if the trigger references a table that has been dropped. Recreate the referenced table or update the trigger body.
A trigger with the same identifier is already defined in the current schema.
A second BEFORE INSERT, AFTER UPDATE, or similar trigger on the same table violates MySQL's one-per-pair rule.
Automated deployment reruns the same CREATE TRIGGER script without first removing the original trigger.
Multiple developers create triggers on a shared database without coordination, causing naming collisions.
Occurs when a trigger references nonexistent fields. Update field names or table schema.
Raised when attempting to drop a trigger that is not found. Double-check trigger name or database context.
Appears during ALTER TRIGGER on a missing trigger. Ensure correct name and schema.
Yes, but each timing-event pair (BEFORE INSERT, AFTER UPDATE, etc.) can have only one trigger. Use different timing or event or merge logic.
Trigger names must be unique only within the current database schema.
Include DROP TRIGGER IF EXISTS before CREATE TRIGGER in migration scripts to make them idempotent.
Galaxy's version-controlled SQL editor highlights existing object names and provides linting so duplicate triggers are caught before execution.