> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/error-codes/mariadb-error-codes-1000-to-1099/e1064.md).

# Error 1064: You have an error in your SQL syntax near at line

| Error Code | SQLSTATE | Error            | Description             |
| ---------- | -------- | ---------------- | ----------------------- |
| 1064       | 42000    | ER\_PARSE\_ERROR | %s near '%s' at line %d |

## Possible Causes and Solutions

The server returns this error for every statement that it can't parse. The message starts with the text of [error 1149](/docs/server/reference/error-codes/mariadb-error-codes-1100-to-1199/e1149.md), followed by the part of the statement where the parser stopped, and the line number:

```
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELEC 1' at line 1
```

To find the mistake:

* Look at the text after `near`. The mistake is there or just before it, often in the last word before that text. The server shows at most 80 characters and cuts off the rest with `...`.
* `near ''` means that the statement ended before it was complete, for example `SELECT 1 FROM` without a table name, or a stored program whose body was cut off at the first `;` because the client used `;` as the [delimiter](/docs/server/clients-and-utilities/mariadb-client/mariadb-command-line-client.md#delimiters).
* The server's line number counts from the start of the statement. When you run a script with the `mariadb` client, the client adds its own `at line` with the line of the script where the statement starts. In this example, the statement starts on line 2 of the script, and the typo `FRM` is on its third line, just before `t`:

  ```
  ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't' at line 3
  ```

For the most common causes, such as missing delimiters, reserved words used as identifiers, and syntax that depends on the [SQL\_MODE](/docs/server/server-management/variables-and-modes/sql_mode.md), see [error 1149](/docs/server/reference/error-codes/mariadb-error-codes-1100-to-1199/e1149.md).

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
