[ACCEPTED]-MySQL disable all triggers-information-schema

Accepted answer
Score: 35

You can't disable triggers directly and 4 I wouldn't recommend doing what you're suggesting 3 but you could have your trigger check if 2 a variable (in my example below @disable_triggers) is NULL before 1 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;

More Related questions