Quick Start
Connect to MySQL
HTTP Tunnel
SSH Tunnel
Databases
Tables
Adding Fields and Choosing Data Types
Customising Fields
Primary Keys and Indexes
Filter Wizard
Foreign Keys
Foreign Keys Data Selection
Triggers
Import/Export
Queries
Visual Query Builder
Stored Procedure
View
Event
Data
Manage Users
Privileges Provided by MySQL
User Editor
Backup
Data Transfer
Schedule
Server Monitor
Data Synchronization
Structure Synchronization
Console
Virtual Grouping
Maintaining your databases/tables
Preferences
General
Tabs
Tables
Queries
  Working With Triggers
 

Support for triggers is included beginning with MySQL 5.0.2. A trigger is a named database object that is associated with a table and that is activated when a particular event occurs for the table.

Create or Edit a Trigger

  1. Open the table in Design View
  2. Select the Triggers tab
  3. To add a new trigger, click Add Trigger button from the toolbar
  4. Use the Trigger Name edit box to set the trigger name.
  5. Choose the fires action from the list.

    Fires Actions
    BEFORE / AFTER The keyword BEFORE indicates the trigger action time. In this case, the trigger should activate before each row inserted into the table. The other allowable keyword here is AFTER.

  6. Select trigger event. This indicates the kind of statement that activates the trigger. It can be one of the following:

    Insert
    The trigger is activated whenever a new row is inserted into the table. For example, INSERT, LOAD DATA, and REPLACE statements.

    Update
    The trigger is activated whenever a row is modified. For example, UPDATE statement.

    Delete
    The trigger is activated whenever a row is deleted from the table. For example, DELETE and REPLACE statement. However, DROP TABLE and TRUNCATE statements on the table do not activate the trigger.

  7. Define Statement.
  8. Click Save or Save As from the toolbar when you are ready to save the table.

Delete a Trigger

  1. Open the table in Design View
  2. Select the Triggers tab
  3. Select the trigger you want to delete and click Delete Trigger button from the toolbar
  4. Click Save or Save As from the toolbar when you are ready to save the table