MySQL throws an error but still executes the query - mysql

I am trying to execute this query in MySQL:
INSERT INTO eier_borettslag(bsID, eierID)
VALUES(1, 1);
MySQL prompts me with this error message:
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
Could someone help me identify the syntax error and explain why the query gets executed even though the syntax is wrong?

Related

ERROR 1064 (42000) Delete statement in RDS

I tried to use RDS MySQL to store my data. This statement works in my local DB.
DELETE FROM movie_recommend mr WHERE mr.user_id = 71
But it's not executed in RDS MySQL.
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 'mr where mr.user_id = 71' at line 1
Any helps what's wrong with the syntax?

Syntax error in MySQL statement, unhelpful error message

I have a MySQL server and I am trying to use
INSERT INTO servers (ip, version, motd, players, plugins, time)
VALUES ('--.---.---.--', '1.13.2', 'redacted', '0', '1', NOW())
ON DUPLICATE KEY UPDATE;
to insert data, but this error message popped up:
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 '' at line 1
I tried this query again on LibreOffice Base and these messages popped up:
SQL Status: HY000
Error code: 1000
Syntax error in SQL statement
SQL Status: HY000
Error code: 1000
syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE
Any help?
Missing statement after on duplicate update

Getting Database putting into sql file

I am trying to get my database example_dog_names into a sql file. The command I have tried to do this is:
example_dog_names > C:/Users/man/Desktop/dbfile.sql;
The error that I am getting says:
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
'example_dog_names < C:/Users/man/Desktop/dbfile.sql' at line 1
What am I missing? I am connected to MySQL, and I executed the command:
USE example_dog_names;
Any help is appreciated!

I am trying to insert into a table using "&" operator in MySql

I am using Server version: 5.6.26 MySQL Community Server (GPL).I am trying to insert into subodh table using & operator using following query
insert into subodh values(&date_of_birth,&name,&age,&qualification,&id);
but it is showing the following 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 '&date
_of_birth,&name,&age,&qualification,&id)' at line 1
please help me.
Thanks

MySQL update Trigger to update data table value After Insert on another table

I have been stumbling on writing some an MySQL trigger and was hopping someone could help me find the most elegant solution to solve my issue. I have Looked many places and cannot seem to find where the bug is in this code. I also tried not adjusting the delimiter as it seems to create problems I am able to create a trigger without setting the delimiter if I replace the update statement by something else.
The code I have is:
USE MyTable
DELIMITER //
--Trigger to update Scheduling 'Status' and 'Retries' values
CREATE TRIGGER `Scheduling-Updatde_After_Result-Insert`
AFTER INSERT ON Results
FOR EACH ROW BEGIN
UPDATE `Scheduling`
SET
Running = FALSE,
Retries = Retries + 1
WHERE ID = NEW.ID;
END//
DELIMITER ;
I get the following errors:
18:03:25 [DELIMITER - 0 row(s), 0.000 secs] [Error Code: 1064, SQL State: 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 'DELIMITER
CREATE TRIGGER acapella.Scheduling-Updatde_After_Result-Insert
' at line 1
Code: 1064 SQL State: 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 'DELIMITER
CREATE TRIGGER Scheduling-Updatde_After_Result-Insert
' at line 1
18:03:25 [END - 0 row(s), 0.000 secs] [Error Code: 1064, SQL State: 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
DELIMITER' at line 1
Code: 1064 SQL State: 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
DELIMITER' at line 1