Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7909737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:34:23+00:00 2026-06-03T12:34:23+00:00

I have a very simple trigger. I cretaed it from Toad for mysql tool

  • 0

I have a very simple trigger. I cretaed it from Toad for mysql tool and deployed it and its working perfect without any problem. when I gave it to the admin to deploy in the production server they are getting errors.

Phpmyadmin error:

1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use

near ” at line 4

Mysql console error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near ‘END’ at line 1

When asked, they are running the code from phpmyadmin and also they tried to run from mysql console they are getting errors

Its really frustrating and irritating why the same thing is running from a GUI tool and not working from a webtool or a console. 3 different behaviors in from three different tools

Then I tried the same thing and I got the error too. Its suprising me why

DROP TRIGGER IF EXISTS TRG_ ;
CREATE TRIGGER TRG_ BEFORE INSERT ON users FOR EACH ROW
BEGIN

  DECLARE X INTEGER;
  SELECT COUNT(*) into X FROM users;
  
  IF X >= 16 THEN -- CHANGE THIS NUMBER 
    SIGNAL SQLSTATE '45000'
    SET MESSAGE_TEXT = 'cant create more users';
  END IF;
 
END;

Can some one tell me what I am doing wrong? I am not sure but I guess its something to do with delimiter keyword which I never understood the purpose.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T12:34:27+00:00Added an answer on June 3, 2026 at 12:34 pm

    Have a look at this question – MySQL: How do I use delimiters in triggers?

    You should use delimiters when create source objects like triggers. The DELIMITER is not a MySQL statement, it a console command, and many MySQL clients supports this command. You may try this code in the MySQL console –

    DROP TRIGGER IF EXISTS TRG_ ;
    
    DELIMITER $$
    
    CREATE TRIGGER TRG_ BEFORE INSERT ON users FOR EACH ROW
    BEGIN
    
      DECLARE X INTEGER;
      SELECT COUNT(*) INTO X FROM users;
    
      IF X >= 16 THEN -- CHANGE THIS NUMBER 
        SIGNAL SQLSTATE '45000'
        SET MESSAGE_TEXT = 'cant create more users';
      END IF;
    
    END$$
    
    DELIMITER ;
    

    As I know some old phpmyadmin versions do not support delimiters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple iPhone app that requires a random integer from 1-100.
I have very simple window where I have 2 buttons - one for cancel,
I have a very simple webforms app that will allow field techs to order
I have some very simple XML: <properties> <property> <name>BobFish</name> <explaination>Bob is a fish.</explaination> </property>
I have a very simple Setup project that copies three dlls into the GAC.
I have a very simple table with two columns, but has 4.5M rows. CREATE
I have a very simple Mac Cocoa app that just has a Web View
I have a very simple python script that should scan a text file, which
I have a very simple linq to sql query in C#: int acctNum =
I have two very simple, identical UITableViews in my app that are populated with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.