Can you modify an existing mysql trigger after it has been created?

Viewed 38723

In mysql I can create a trigger, and then show information about it like this:

mysql> show triggers like 'fooTrigger';

This command gives output that looks an awful lot like a select statement, with a row showing the matching trigger. Is it possible to update a column on the row it shows me?

For example, one column is named Statement, and it defines what happens when the trigger is activated. Is it possible to change the Statement field for fooTrigger so the trigger does something different? Or do I need to drop and re-create the trigger?

3 Answers

As @Jocelyn mentioned you can't alter the trigger. But if you're using MySql Workbench it will allow you to alter the trigger. Just right click on your table name and click Alter table option from there you can pick Trigger option and alter it. Although you cannot perform it from query. Table Name --> Alter Table --> Triggers.

Related