You can’t disable triggers directly and I wouldn’t recommend doing what you’re suggesting but you could have your trigger check if a variable (in my example below @disable_triggers
) is NULL
before executing the trigger’s content. For example:
Query:
SET @disable_triggers = 1;
// Your update statement goes here.
SET @disable_triggers = NULL;
Triggers:
IF @disable_triggers IS NULL THEN
// Do something use as the trigger isn't disabled.
END IF;