0

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?

5
  • 1
    Does redacted contain a single quote? Can you show your actual code? Commented Dec 10, 2018 at 15:06
  • 2
    On duplicate key update what? Is that your complete insert statement? Commented Dec 10, 2018 at 15:07
  • @FrankerZ It only contains alphabet and spaces, the string is escaped Commented Dec 10, 2018 at 15:12
  • This needs a minimal reproducible example. Commented Dec 10, 2018 at 15:13
  • @P.Salmon yes it is, just realized the mistake, thanks Commented Dec 10, 2018 at 15:15

1 Answer 1

1

Missing statement after on duplicate update

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, MySQL is asking "on duplication update...what?"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.