mySQL and express throwing error with working query - mysql

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

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?

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

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?

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