// MySQL error reference

MySQL error 1149: SQL syntax error

A syntax error with only the generic message and no position. Most parse errors are reported as 1064, which also shows where parsing stopped.

Error number
1149
Name
ER_SYNTAX_ERROR
SQLSTATE
42000
Category
Syntax and statements
Error message
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use

What it means

1149 (ER_SYNTAX_ERROR) carries the text You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use without the near ... at line part. That same text is the start of most 1064 messages, so if you're searching for the message, 1064 is the error you most likely have.

Common causes

  • Malformed SQL in a context where the server reports the error without a position.
  • The same mistakes that cause 1064: reserved words as names, missing commas or quotes, syntax from another database.

How to fix it

  1. Check the statement as for 1064: reserved words, punctuation and syntax supported by your server version.

  2. Run the statement on its own in the mysql client to get the 1064 message with a position.

Related errors

More syntax and statements errors

The code and message text are from the MySQL 8.4 Error Message Reference. Browse the full MySQL error list or search every database error.

// fewer errors, faster fixes

Work on MySQL in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for MySQL and the other databases you use.