/    /  MySQL – DROP Trigger

MySQL – DROP Trigger

 

By using the DROP TRIGGER statement, we can drop/delete/remove a trigger from MySQL. It is very important to exercise caution when removing a trigger from a table. Once a trigger has been deleted, it cannot be recovered. A DROP TRIGGER statement throws an error if no trigger is found.

The following syntax can be used to drop an existing trigger from the database using the DROP TRIGGER statement:

Syntax:

DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name; 

Here are the parameters used in the drop trigger syntax:

Trigger_name: This is the name of a trigger that we wish to remove from the database server. This parameter is required.

Schema_name: This is the name of the database to which the trigger belongs. In the event that we skip this parameter, the statement will remove the trigger from the current database.

IF_EXISTS: It is an optional parameter that conditionally removes triggers only if they are present on the database server.

Example:

DROP TRIGGER IF EXISTS age_verify3;

d1