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
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
-
Check the statement as for 1064: reserved words, punctuation and syntax supported by your server version.
-
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
1052Column is ambiguous1055Expression isn't in GROUP BY1093Can't specify target table for update1136Column count doesn't match value count1242Subquery returns more than 1 row1248Every derived table must have its own alias1318Incorrect number of arguments
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.
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.