Home

How to fix the MySQL error 1064?

Alton Alexander
By Alton AlexanderUpdated on June 4th, 2022

Mysql error 1064 occurs when there is an error in the syntax of a query. This can happen when a query is incorrectly written, or when there are incorrect values in the query. This error can also occur if the database is not configured correctly.

Users typically search for a solution by asking about:

  • error code 1064
  • error code 1064 mysql
  • error code: 1064
  • mysql error code 1064
  • mysql error 1064

1. Check your SQL syntax for errors

There are a few steps you can take to check your SQL syntax for errors in order to fix mysql error 1064. The most basic way to do this is to use the mysql command line tool to check your syntax. You can also use a free online SQL syntax checker like Semantic Scholar. If you are using MySQL, you can also use the mysql -u root -p command to check your syntax. You can also use the mysql -p command to check your syntax for specific errors. If you are using a different database, there are different syntax checking tools available. For example, you can use the phpMyAdmin tool to check your syntax for errors in yourphp database.

2. If you are using a GUI tool, check to make sure you are not accidentally inserting extra characters into your SQL query

  1. Open the MySQL client application.
  2. Type the following command into the MySQL client application: SELECT @@sql_mode;
  3. If the @@sql_mode value is NULL, then MySQL is in command-line mode and you can issue SQL commands to the MySQL server.
  4. Type the following command into the MySQL client application: SELECT * FROM table;
  5. If the table does not exist, MySQL will create it.
  6. Type the following command into the MySQL client application: SELECT column1, column2 FROM table;
  7. If the table does not exist, MySQL will create it.
  8. Type the following command into the MySQL client application: SELECT row1, row2 FROM table;

3. If you are using a command-line tool, check to make sure you are not accidentally inserting extra characters into your SQL query

If you see output like this: mysql Ver 8.0.13-MariaDB-log Mar 2 20:51:21 2016 Then you are good to go. If you see something like this: mysql> You may need to use a different mysql client.

Still not working? maybe try:

  1. If you are using a script, check to make sure you are not accidentally inserting extra characters into your SQL query
  2. Make sure you are using the correct MySQL version for your SQL syntax