mysql - SQL 错误 1064 - 导入错误

标签 mysql sql import

我将数据库导出为工作正常的备份。当我将数据库导入到完全相同的服务器、文件夹等时,出现此错误:

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

唯一的问题似乎是我的索引页缺少内容,实际上是主要内容。所有这些文件都是 .sql。

然后我删除了所有表并导入了去年 4 月的原始数据库。显然,这个数据库缺少我所有客户的所有帐户信息、订单信息等,以及对我的产品所做的所有更改。

当我比较这两个数据库时,前 11 行似乎是问题所在,但我不知道如何解决。文件的前 11 行不起作用:

-- 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";

文件的前 11 行是:

-- 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";

我曾尝试简单地将工作文件中的 11 行复制并粘贴到不起作用的文件中,但出现了另一个错误。

我知道这是一篇很长的帖子,我深表歉意,但我已经为此苦苦挣扎了几个小时,真的需要一些帮助。

谢谢

最佳答案

好的,这就是我终于找到的东西。当我在 notebook+ 中打开给我错误的文件时,最后一行当然有以下内容:

ETXNULNULNULNULNULNULNULNULNUL

打开时的原始工作数据库没有任何这些字符。

当我简单地删除给我错误的文件的最后一行并导入数据库时​​,一切正常。但是,我的主页仍然没有被正常拉起。我现在应用了一个解决方法,稍后会尝试解决这个问题。

我希望这对某人有帮助。

关于mysql - SQL 错误 1064 - 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19004101/

相关文章:

mysql - 临时表在 PHPMyAdmin 中不起作用

php - 在php中动态创建类事件

mysql加载数据到文件系统锁定状态

mysql - 具有两个不同表和条件的 SELECT sql 语句

css - LESS 编译器和相关 @import 引用在 Web Essentials 2012 v2.7 中不起作用

django - 在另一个应用程序 View 中导入 django 应用程序 View

php - 字符编码问题

mysql - 检索 SQL 列中特定值的百分位

mysql - LEFT JOIN 到最新行

android - 如何将 android studio 项目从 linux 移植到 windows