While I am trying to insert a row to my table, I\'m getting the following errors:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
This Error comes due to same table exist in 2 database like you have a database for project1 and in which you have table emp and again you have another database like project2 and in which you have table emp then when you try to insert something inside the database with-out your database name then you will get an error like about
Solution for that when you use mysql query then also mention database name along with table name.
OR
Don't Use Reserved key words like KEY as column name
This error comes when you have a column name from one of the mysql keyword, try to run your queries by putting all your column names in `` this
example: insert into test (`sno`, `order`, `category`, `samp`, `pamp`, `method`) values(1, 1, 'top', 30, 25, 'Total');
In this example column name order is a keyword in mysql, so i had to put that in `` quotes.
I encountered this same error: 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 ', completed)' at line 1
This was the input I had entered on terminal: mysql> create table todos (description, completed);
Solution: For each column type you must specify the type of content they will contain. This could either be text, integer, variable, boolean there are many different types of data.
mysql> create table todos (description text, completed boolean);
Query OK, 0 rows affected (0.02 sec)
It now passed successfully.
This solution is for windows: