I am trying to define a trigger in MySQL and the language to create it never executes. I have already defined and inserted data into the database with no problem.

This is the start of my trigger. As you can see I put some giberish in there to illustrate that this never executes because it produces no errors at all.

delimiter //

\qeiksdhsnthd-/rcg dsth

CREATE TRIGGER deleted_insert
ON item
        ...etc body of trigger


delimiter ;

Executing this does absolutely nothing and does not return any output from the sql server. If I do not change the delimiter, then it does execute but produces a syntax error on the 'ON' keyword.

How can simply declare this trigger?

  • 1
    It looks like you're using T-SQL / Microsoft SQL Server syntax, not MySQL syntax. – AMtwo Feb 10 at 1:25
  • 1
    Doesn’t look like you’re terminating with the // delimiter you declare at the beginning. – eroomydna Feb 10 at 6:53
  • The syntax for CREATE TRIGGER in MySQL. – danblack Feb 10 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.