简体   繁体   中英

Mysql Error While Importing

I am trying to import Mysql Data taken from Wordpress blog locally on Window 7 system. One way or other it is giving error.

The table wp_commentmeta was giving error. I have deleted all aksimet rows, but still error was coming. So, quit that table and included other tables. But now as well error is coming, which I do not understand:

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---- eNo1jTsKwzAQRAPu9hRzACEs2S6ynRDCDugXSYlPkCKN+9w+ciBTDY/HjCslFYZVsBreRYaChlJU W8cDUfjUu2cscpGTpkctSFXArC42gafr0v4+YLeSguvWKKeRcjCMufdZKspbPj2R6rnSyRX7LcZG 3sSV8Trod0DD5Z8vxK4ftA== ----END CUT---- ----BEGIN RAW---- ERROR: C1 C2 LEN: 1 2 11 STR: MySQL: 5.5.32 USR OS, AGENT, VER: Win CHROME 5.0.30 PMA: 4.0.4.1 PHP VER,OS: 5.4.19 WINNT 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 error is from PHPMyAdmin.

Just a warning message for everyone. I remember, I used to use command line more than any tool like phpMyAdmin. Today phpMyAdmin has taken so many hrs. phpMyAdmin was not exporting correctly and all problem was due to that.

Not even phpMyadmin could import its own exported data. I used mysqldump and then mysql ... db < sql.sql and it worked at lightening speed.

#mysqldump -u userName -p --add-drop-table --insert-ignore --result-file downloads/db_name_dump-oct-14.sql db_name

Then downloaded the file using FileZilla, and on Wins 7:

>mysql -u root -proot  wordpress < db_name_dump-oct-14.sql

Remember, do not give semi-colon at last.

Those characters are an encoded parser report. When decoded with scripts/decode_bug.php, it reports: ERROR: C1 C2 LEN: 1 2 11 STR:

MySQL: 5.5.32 USR OS, AGENT, VER: Win CHROME 5.0.30 PMA: 4.0.4.1 PHP VER,OS: 5.4.19 WINNT LANG: en SQL:

So, it cannot report which SQL statement gave a problem. Maybe your import operation was incomplete, due to some incorrect server settings. See FAQ 1.16 in phpMyAdmin documentation include in your kit, or http://www.phpmyadmin.net/home_page/docs.php .

Check the last line of your .sql file in an editor(Sublime Text or whatever you prefer). Does it have strange characters there? ETXNULLNULLNULLNULL etc. Remove that line and retry your import. Worked for me.

Just want to tack on a note that using TextWrangler I could not see the extra characters or text at the end of the sql document; however, I did see a white space, so I selected and deleted it, then saved. When I then imported into the database, the error disappeared! So take heart, Mac users, or rather TextWrangler users, who might have been mystified by the missing characters.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM