简体   繁体   English

将数据库导入站点时出错

[英]error when importing database to site

When I'm trying to import my database to my site through a .sql file, I always get an error and I don't know what to make of it.当我尝试通过.sql文件将我的数据库导入我的站点时,我总是收到一个错误,我不知道该怎么做。

I will post the error below.我将在下面发布错误。

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:如果您仍然有问题,或者如果解析器在命令行界面成功时失败,请将您的 SQL 查询输入减少到导致问题的单个查询,并在下面的 CUT 部分提交包含数据块的错误报告:

----BEGIN CUT----
eNodjTsOwjAUBKnfKfYAwYo/EHBnRU5AcmJjh0+PKCJF7pDg9jjUM7NrY/RRo+VoBZwdNTgEVHPc
15SmQjZEwzddnMaOcdbI7XNZ6JoifKpgejtOFW62iPc5oztH2/kHJGc1hcFoqBIdKJzCKlU+rTOK
CQk35/eHnBl7jVem/8MPI0shyQ==
----END CUT----
----BEGIN RAW----

ERROR: C1 C2 LEN: 1 2 47960
STR: 

MySQL: 5.1.73-cll
USR OS, AGENT, VER: Win FIREFOX 31.0
PMA: 4.1.8
PHP VER,OS: 5.4.23 Linux
LANG: en
SQL: 

----END RAW----

The actual error message is:实际的错误信息是:

#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 'U' at line 1检查与您的 MySQL 服务器版本相对应的手册,以获取在第 1 行的“U”附近使用的正确语法

First lines from the .sql: .sql 中的第一行:

USE [kal_auth]
GO
/****** Object:  User [kal]    Script Date: 08/11/2014 14:44:15 ******/
CREATE USER [kal] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[kal]
GO
/****** Object:  Schema [kal]    Script Date: 08/11/2014 14:44:04 ******/
CREATE SCHEMA [kal] AUTHORIZATION [kal]
GO
/****** Object:  Table [dbo].[CNum]    Script Date: 08/11/2014 14:44:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CNum](
[UID] [int] NOT NULL,
[Num] [int] NOT NULL,
CONSTRAINT [PK_CNum] PRIMARY KEY CLUSTERED 

You haven't found a bug in the SQL parser.您还没有在 SQL 解析器中发现错误。 You're simply trying to run SQL Server code in MySQL.您只是尝试在 MySQL 中运行 SQL Server 代码。


The SQL acronym refers to a computer language used to query relational databases. SQL 首字母缩写词是指用于查询关系数据库的计算机语言。 Products that can speak SQL often include SQL on their names (MySQL, SQL Server, PostgreSQL...) but that's all, a name.会说 SQL 的产品通常在其名称中包含 SQL(MySQL、SQL Server、PostgreSQL...),但仅此而已,只是一个名称。 The term itself represents a language , not a specific product.该术语本身代表一种语言,而不是一种特定的产品。

The SQL language is useful because it doesn't belong to a single vendor. SQL 语言很有用,因为它不属于单个供应商。 However, each vendor implements its own dialect.但是,每个供应商都实现了自己的方言。 You simple cannot run arbitrary SQL on an arbitrary system.你不能在任意系统上运行任意 SQL。

the hosting provider said MSSQL is enabled, just not very popular托管服务提供商说 MSSQL 已启用,只是不太流行

MSSQL is not an option inside MySQL. MSSQL不是MySQL 中的一个选项。 It's an entirely different piece of software.这是一个完全不同的软件。

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

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