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

前端 未结 10 609
悲&欢浪女
悲&欢浪女 2021-02-01 04:28

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         


        
相关标签:
10条回答
  • 2021-02-01 05:01

    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

    0 讨论(0)
  • 2021-02-01 05:05

    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.

    0 讨论(0)
  • 2021-02-01 05:07

    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.

    0 讨论(0)
  • 2021-02-01 05:08

    This solution is for windows:

    1. Open command prompt in Administrator Mode.
    2. Goto path: C:\Program Files\MySQL\MySQL Server 5.6\bin
    3. Run below command: mysqldump -h 127.0.01 -u root -proot db table1 table2 > result.sql
    0 讨论(0)
提交回复
热议问题