SQL Error 1064 - Import Error

35,553

Solution 1

OK, so here is what I found, finally. When I opened the file that was giving me the error in notebook+, the last line, of course, had the following:

ETXNULNULNULNULNULNULNULNULNUL

The original working database when opened did not have any of these characters.

When I simply deleted the last row of the file that was giving me the error and imported the database, everything worked fine. However, my homepage was still not being pulled up properly. I applied a workaround for now and will try to figure that out later.

I hope this helps someone.

Solution 2

I had the same problem when exporting my database for a Joomla 2.5 site. It has something to do with the compression in phpmyadmin. I changed the compression from "none" to "zipped" before exporting the database and that solved it.

Hope that helps!

Solution 3

In my case I need to change compression to NONE and SQL compatibility mode to ANSI. I was exporting WordPress database to the another server.

Solution 4

As it seems there are a bunch o reasons that could trigger this error. I just wanted to share my problem and the workaround i found for it, hopefully it would save someone some time. I too encountered this problem while trying to import a database to MySql. I had exported a version of a database from my local machine and i wanted to import it to the server where my website is hosted. problem was that there was a mismatch between the versions of the two systems. I managed to get around the problem by using the compatibility option(both while exporting and while importing). i used "MYSQL323" . This fixed my problem. I think this is a good solution for those who have the possibility to make a fresh exported version of the database.

Share:
35,553
210 USA
Author by

210 USA

Really new at all of this and trying to get my head around it.

Updated on July 18, 2022

Comments

  • 210 USA
    210 USA almost 2 years

    I exported a database as a backup that was working fine. When I imported the database to the same exact server, folder, etc. I got this error:

    There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below: ----BEGIN CUT---- eNo1jUEKwjAURIXu/inmADHkpwYxu1JCu0iTmFQ9gYtushP09qaCs3oMjxmXc8wWI2PU8C5YMDSY qayt7oiWT7l6CyON7NWxV5LpVjJiERgmF1aBu2vmY6sY5xwX11Ql9YXSMlicGhtKc9otEcs+1Es+ w2/19SY/hMniWen3Qd3hny8nMiDI ----END CUT---- ----BEGIN RAW---- ERROR: C1 C2 LEN: 1 2 11 STR:

    MySQL: 5.5.30-30.1 USR OS, AGENT, VER: Win CHROME 5.0.29 PMA: 4.0.5 PHP VER,OS: 5.3.17 Linux LANG: en SQL:
    ----END RAW----

    SQL query:

    MySQL said: Documentation

    #1064 - 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 '' at line 1

    The only problem seems to be that my index page is missing content, the main content actually. All of these files are .sql.

    I then dropped all my tables and imported the original database from April of last year. Obviously, this database is missing all the account info, order info, etc. for all my customers as well as all the changes that have been made to my products.

    When I compare the two databases the first 11 lines seem to be the problem but I don't know how to fix it. The first 11 lines of the file that DO NOT WORK are:

    -- phpMyAdmin SQL Dump
    -- version 4.0.5
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Sep 22, 2013 at 01:28 PM
    -- Server version: 5.5.30-30.1
    -- PHP Version: 5.3.17
    
    SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
    SET time_zone = "+00:00";
    

    The first 11 lines of the file that DOES WORK are:

    -- phpMyAdmin SQL Dump
    -- version 3.4.10.1
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Apr 09, 2012 at 05:50 AM
    -- Server version: 5.1.61
    -- PHP Version: 5.2.17
    
    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    SET time_zone = "+00:00";
    

    I hve tried to simply copy and paste the 11 lines from the working file to the file that does not work and get another error.

    I know this is a long post and I apologize but I have been struggling with this for hours and really need some help.

    Thanks

  • Henry J
    Henry J over 10 years
    it work, however, i wondering if it was the .sql file's generating's faults? thank you!
  • hitautodestruct
    hitautodestruct over 10 years
    I had the same ETXNULNUL.. line at the end of my sql file. Removing it did the trick.
  • Prembo
    Prembo over 10 years
    Yes I had the same problem too with the ETXNULNULNUL characters. Software versions used for export are: MySQL: 5.5.32-cll, phpMyAdmin: 4.0.5, PHP: 5.3.17. Looking at everyone else's posts it looks like a common denominator is PHP 5.3.17.
  • Tony M
    Tony M over 10 years
    Yep, same thing for me, getting rid of the last line in the sql file solved this issue! Thanks!
  • thewaywewere
    thewaywewere about 7 years
    Please read this how-to-answer for providing quality answer.