简体   繁体   English

导入时出现Mysql错误

[英]Mysql Error While Importing

I am trying to import Mysql Data taken from Wordpress blog locally on Window 7 system. 我正在尝试从Windows 7系统上的本地Wordpress博客导入Mysql数据。 One way or other it is giving error. 一种或其他方式产生错误。

The table wp_commentmeta was giving error. 表wp_commentmeta提供了错误。 I have deleted all aksimet rows, but still error was coming. 我已经删除了所有aksimet行,但是仍然出现错误。 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. 错误 :您有可能在SQL解析器中发现了一个错误。 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. 您也可以在MySQL命令行界面上尝试查询。 The MySQL server error output below, if there is any, may also help you in diagnosing the problem. 下面的MySQL服务器错误输出(如果有的话)也可以帮助您诊断问题。 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: 如果仍然有问题,或者解析器在命令行界面成功的地方失败,请减少您的SQL查询输入到导致问题的单个查询,并在下面的CUT部分中提交包含数据块的错误报告:---- BEGIN CUT ---- eNo1jTsKwzAQRAPu9hRzACEs2S6ynRDCDugXSYlPkCKN +9瓦特+ 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 WINL LANG:zh-SQL:
----END RAW---- SQL query: MySQL said: Documentation ---- END RAW ---- SQL查询:MySQL表示:文档
#1064 - You have an error in your SQL syntax; #1064-您的SQL语法有误; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 检查与您的MySQL服务器版本相对应的手册,以在第1行的''附近使用正确的语法

The error is from PHPMyAdmin. 错误是来自PHPMyAdmin。

Just a warning message for everyone. 只是对所有人的警告消息。 I remember, I used to use command line more than any tool like phpMyAdmin. 我记得,我过去经常使用命令行而不是像phpMyAdmin这样的任何工具。 Today phpMyAdmin has taken so many hrs. 今天,phpMyAdmin已经花费了很多小时。 phpMyAdmin was not exporting correctly and all problem was due to that. phpMyAdmin没有正确导出,所有问题都是由于该原因。

Not even phpMyadmin could import its own exported data. 甚至phpMyadmin都无法导入自己的导出数据。 I used mysqldump and then mysql ... db < sql.sql and it worked at lightening speed. 我先使用mysqldump,然后使用mysql ... db <sql.sql,它以闪电般的速度工作。

#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: 然后使用FileZilla下载文件,并在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: 当使用scripts / decode_bug.php解码时,它报告:错误: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: MySQL:5.5.32 USR OS,AGENT,VER:Win CHROME 5.0.30 PMA:4.0.4.1 PHP VER,OS:5.4.19 WINL LANG:zh-SQL:

So, it cannot report which SQL statement gave a problem. 因此,它无法报告哪个SQL语句出了问题。 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 . 请参阅套件中随附的phpMyAdmin文档中的FAQ 1.16,或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). 在编辑器中检查.sql文件的最后一行(Sublime Text或您喜欢的任何内容)。 Does it have strange characters there? 那里有奇怪的人物吗? ETXNULLNULLNULLNULL etc. Remove that line and retry your import. ETXNULLNULLNULLNULL等。删除该行,然后重试导入。 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; 只是想补充一点,使用TextWrangler,我在sql文档的末尾看不到多余的字符或文本。 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. 因此,请Mac用户或TextWrangler用户振作起来,他们可能对丢失的字符感到困惑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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