• Register
3,890 points
11 5 1

Some times the users encounter this error if they have some error in their code syntax of MySQL. When there are some errors in code syntax then the following error will occur;

“you have an error in your SQL syntax; check the manual test that corresponds to your MySQL server version for the right syntax to use near”

Example:

mysql> create table DemoTable689(

   UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,

   UserName varchar(100),

   UserLoginDate date(100) NOT NULL

);

Output:

This will produce the following output;

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 '(100) NOT NULL

)' at line 5

Solution:

Let's fix this error 1054. For that, the user has to use only DATE NOT NULL. For this create a table like;

mysql> create table DemoTable689(

   UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,

   UserName varchar(100),

   UserLoginDate date NOT NULL

);

Now insert some records in the table by using the insert command. By using the select command all the data will be displayed in table format.

3,890 points
11 5 1