MYSQL Wamp Server - mysql

please help me out in the following code its a syntax error but i don't understand where is the error i tried to run this trigger on Wamp server
here is the code:
CREATE TRIGGER Drivers_type_constraint BEFORE INSERT ON Cars
FOR EACH ROW
BEGIN
IF ((NEW.driver_name='null')||(NEW.driver_age<17)) THEN
DELETE from Drivers where driver_id = NEW.driver_id;
END IF;
END;
/
Error
you have an error in your SQL Syntax; Check the manual that correspond to your sql server version for the right syntax to use near '' at line 8
If anyone want to suggest any idea it would be appreciated thanks in advance.

Related

MySQL Workbench - Stored Procedure - Error - No reference in manual

I am using MySQL workbench 8.0.18 on a mac.
I am trying to run the following stored procedure using $$ as my delimiter. It is not running and giving me the error
Error Code: 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 3
And here is the code with the delimiter:
delimiter $$
create procedure HelloWorld()
begin
select 'Hello World!';
end $$
I have gone through the documentation for mysql workbench but could not find any relevant answer pertaining to it.
Thank you for your help in advance.
You have to run this in a NORMAL query tab when you want to use DELIMITER:
If you want to add a procdure in new_procedure Routine
Leave out the DELIMITER completely,
When you save the procedure Workbench will add the DELIMITER abd DEFINER automatically

Cannot create tables through PopSQL - ER_PHRASE_ERROR

I'm completely new to SQL and trying to learn online. I'm trying to create tables in MySQL through PopSQL, but I keep getting a syntax error. Not sure what I'm doing wrong. Picture attached for reference. Any help will be appreciated.
My query is:
CREATE TABLE studentinfo ();
And the error I get when trying to run it is:
ER_PARSE_ERROR: 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 1
Link for reference

Mysql error #1064 in Drupal

I have a problem when I upload mysql from localhost to my server. The error message show like below.
Error
Static analysis:
1 errors were found during analysis.
A closing bracket was expected. (near ")" at position 76)
SQL query:
CREATE TABLE actions ( aid varchar(255) NOT NULL DEFAULT '0'COMMENT )
MySQL said: Documentation
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 3
enter image description here
Please help me. how to fix this error....
I just try many ways to solve mysql error. Fortunately, I found the ways to fix it. Just update phpmyadmin version in localhost to be the same at server version.
Then, it's worked for me.
Hope this way help you to solve your error when you get the same at me.

Mysql Collation does not work

I insert some text which i scrap from remote server and the problem is that in the text here is symbol.
� which makes a syntax error insert doe not work .Any ideas about this a
paradox????? I've tried almost all collation nothing works.Text is in armenian.
SQLSTATE[42000]: Syntax error or access violation: 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 1
Thanks in advance
FIXED..!!!The problem was when create an instance of PDO I didn't mention this part
charset=utf8

Can't find out what's wrong with this MySQL event syntax

I'm trying to create a MySQL event, and this is the syntax I'm using:
CREATE EVENT test
ON SCHEDULE AT FROM_UNIXTIME(1428005286)
DO
BEGIN
UPDATE blog_posts SET status = 'published' WHERE id = 5;
END
When I run it on Node.js (with the mySQL adapter, under Sails.js), I get no error, but the event doesn't get created. When I run it directly through phpMyAdmin, I get:
#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 5
I have also tried adding a semicolon to END, making it END;, and removing all semicolons, and it returns a slightly similar 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 'END' at line 6
I have no idea why this is happening. Any help is appreciated. Thanks.
You probably need to start with: create DEFINER=root#localhost ...
Also, since this is a one-liner, you don't need BEGIN..END