Syntax error in MySQL statement, unhelpful error message - mysql

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

Related

ERROR 1064 (42000) ... 'ACCOUNT LOCK' at line 1

I'm trying to lock one account and doing a simple command:
ALTER USER 'user_name'#'localhost' ACCOUNT LOCK;
And I getting such 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 'ACCOUNT LOCK' at line 1
What am I doing wrong? Using 5.6.51 MySQL

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?

mySQL and express throwing error with working query

I am getting an error when trying to send data from express to mysql. The query itself works fine when ran in mysql, but throws a syntax error in express. Here is the error
code: 'ER_PARSE_ERROR',
errno: 1064,
sqlMessage: "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 'INSERT INTO accounts (strPassword) VALUES ('$2a$12$UA.y6cWYV6r0mXiYYi0iQuNBtZzit' at line 1",
sqlState: '42000',
index: 0,
sql: "BEGIN; INSERT INTO accounts (strPassword) VALUES ('$2a$12$UA.y6cWYV6r0mXiYYi0iQuNBtZzit4jQPJ2pt8P7od6VPnhjTuC3O'); INSERT
INTO accountdetails (intAccountID, strUserName, dtmDOB, strEmail, strIGN) VALUES (LAST_INSERT_ID(), 'test3', '1994-3-4', 'test3#test.com' ,'test3'); COMMIT;"
Other queries work fine o

MySQL throws an error but still executes the query

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?

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