- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Resolve MySQL ERROR 1064 (42000): You have an error in your syntax?
This error occurs if let’s say you used var_char instead of varchar type. To remove this type of error, use, for example, varchar(100) instead of var_char(100).
Let us now see how this error occurs −
mysql> create table removeErrorDemo -> ( -> StudentId int, -> StudentName var_char(50) -> );
The following is the output displaying the 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 'var_char(50) )' at line 4
Now let us remove the error. Here is the query to remove error 1064 (42000) −
mysql> create table removeErrorDemo -> ( -> StudentId int, -> StudentName varchar(100) -> ); Query OK, 0 rows affected (1.72 sec)
Above, we have set varchar correctly, therefore no error will occur.
Advertisements