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 646
悲&欢浪女
悲&欢浪女 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 04:50

    C:\xampp>mysql -u root -p mydatabase < C:\DB_Backups\stage-new.sql
    Enter password:
    ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the ma
    nual that corresponds to your MySQL server version for the right syntax to use n
    ear 'stage-new.sql
    
    ----lot of space----
    
    ' at line 1
    

    The reason was when I dumped the DB I used following command :

    mysqldump -h  -u  -p  > dumpfile.sql
    dumpfile.sql
    

    By mistaken dumpfile.sql added twice in the syntax.

    Solution : I removed the dumpfile.sql text added to first line of the exported dumpfile.

提交回复
热议问题