mysql创建表格显示1064错误_尝试创建表时出现错误1064(Error 1064 when trying to create a table)...

尝试创建表时出现错误1064(Error 1064 when trying to create a table)

这是代码:

create table `team`.`User`(

`UserID` bigint NOT NULL AUTO_INCREMENT ,

`Username` text(30) NOT NULL ,

`Email` text(30) NOT NULL ,

PRIMARY KEY (`UserID`)

) Engine= [default] comment='' row_format=Default

并且错误消息:

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

'[default] comment='' row_format=Default' at line 6

有人能告诉我为什么我会收到此错误以及如何修复它?

编辑:此代码由SQLyog自动生成。 似乎引擎位导致了问题。 有谁知道如何使用SQLyog设置默认引擎?

Here is the code:

create table `team`.`User`(

`UserID` bigint NOT NULL AUTO_INCREMENT ,

`Username` text(30) NOT NULL ,

`Email` text(30) NOT NULL ,

PRIMARY KEY (`UserID`)

) Engine= [default] comment='' row_format=Default

And the error message:

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

'[default] comment='' row_format=Default' at line 6

Can someone tell me why I'm getting this error and how to fix it?

EDIT: This code was automatically generated by SQLyog. It seems that the Engine bit is causing the problem. Does anyone know how to use SQLyog to set the default engine?

原文:https://stackoverflow.com/questions/11341703

更新时间:2020-10-01 20:10

最满意答案

据我所知,方括号在MySQL中没有任何特殊含义。 你可能与其他一些DBMS混淆了。

ENGINE关键字的有效语法是ENGINE [=] engine_name 。 例如:

ENGINE=InnoDB

... 要么

ENGINE InnoDB

如果您不关心存储引擎,请删除该子句,MySQL将使用默认值。

As far as I know, square brackets don't have any special meaning in MySQL. You're probably confused with some other DBMS.

Valid syntax for the ENGINE keyword is ENGINE [=] engine_name. E.g.:

ENGINE=InnoDB

... or

ENGINE InnoDB

If you don't care about the storage engine, remove the clause and MySQL will use the default.

2012-07-05

相关问答

你在moddate之后错过了一个逗号,并且不确定你是否需要ADD ..... ...

elevation INT(15) NULL,

gtopo30 INT(15),

timezone VARCHAR(40),

moddate DATE,

INDEX (latitude),

INDEX (longitude),

INDEX (fclass)

或者,您可以在创建表后在单独的语句中创建索引,这可能会更容易。 CREATE INDEX id_latitude ON allCountries(l

...

每次声明后都缺少逗号: CREATE TABLE Party_Library

(

Party INT(11),

Library varchar(40),

PRIMARY KEY (Library,Party),

FOREIGN KEY (Party) REFERENCES Party(PartyKey) ON DELETE CASCADE,

FOREIGN KEY (Library) REFERENCES MusicLibraries(MusicSource

...

在上一个列定义之后删除逗号: CREATE TABLE Users(

Usrid INT unsigned auto_increment PRIMARY KEY not null,

Username varchar(20),

Name varchar(25),

Surname varchar(25),

Email varchar(50),

Password varchar(50),

);

它应该是 CREATE TABLE Users(

Usrid

...

您应该从最后一个条目中删除逗号: CREATE TABLE users

(

`a` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,

`b` VARCHAR(50) DEFAULT "USER",

`c` INT(1) NOT NULL DEFAULT "0",

`d` VARCHAR(30) NOT NULL,

`e` VARCHAR(30) NOT NULL,

`f` TEXT(30) NOT NULL,

...

你刚刚错过了性别专栏。 CREATE TABLE clan(

first_name VARCHAR(30) NOT NULL,

last_name VARCHAR(30) NOT NULL,

city VARCHAR(30) NOT NULL,

country VARCHAR(30) NOT NULL,

zip MEDIUMINT UNSIGNED NOT NULL,

birth_date DATE NOT NULL ,

sex ENUM("M", "F") NOT NULL,

clan_belo

...

使用圆括号对() 。 不是卷曲的{} 。 还要确保已创建具有完全相同类型的id列的user表。 Use round parenthesis pair (). NOT the curly ones {}. Also make sure you have created user table with an id column with exact same type first.

您的create table语句看起来很好,但是之后没有添加分号: create database isathub

所以它没有执行该语句,并认为create table语句是create database语句的一部分。 Your create table statement looks fine, but you didn't put a semicolon after: create database isathub

So it didn't execute that statement,

...

这是MySQL存储过程的无效语法。 您发布的代码看起来更像Microsoft SQL Server(Transact SQL)语法。 一些观察: MySQL过程变量不能以@开头。 (该字符保留给用户定义的变量。) MySQL不使用NVARCHAR类型。 我相信这是session中character_set_client变量的设置(在创建过程时)是控制过程变量的字符集的东西。 在CREATE PROCEDURE看起来完全select * from parent_user,之前,行select * f

...

据我所知,方括号在MySQL中没有任何特殊含义。 你可能与其他一些DBMS混淆了。 ENGINE关键字的有效语法是ENGINE [=] engine_name 。 例如: ENGINE=InnoDB

... 要么 ENGINE InnoDB

如果您不关心存储引擎,请删除该子句,MySQL将使用默认值。 As far as I know, square brackets don't have any special meaning in MySQL. You're probably confus

...

你混淆了oracle和MySQL。 MySQL不提供VARCHAR2而不提供NUMBER 。 另请参阅此页面以了解Oracle和MySQL中的数据类型差异 。 CREATE TABLE DW.BOOKS(

BIO VARCHAR(250) NOT NULL ,

ID INT(10) NOT NULL ,

REVENUE VARCHAR(20) ,

PRIMARY KEY (ID)

);

You are confusing oracle and

...

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在使用Anaconda创建虚拟环境出现"An HTTP error occurred when trying to retrieve this URL"的错误提示。这个错误通常是由于网络连接问题导致的。有几种解决方法可以尝试: 1. 使用清华大学镜像源:打开清华大学镜像源网站(https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/),将网站中提供的代码复制到.condarc文件中。该文件位于C:\Users\用户名目录下,如果没有则手动创建并进行粘贴。这样就可以使用清华大学镜像源来下载所需的包,从而解决网络连接问题。 2. 手动创建.condarc文件:在命令提示符(cmd)中输入"conda config"命令,系统会自动创建.condarc文件。然后在C:\Users\用户名目录中找到.condarc文件,用文本编辑器打开并将里面的内容替换成以下内容: channels: - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ show_channel_urls: true ssl_verify: false 这样也可以使用清华大学镜像源来下载所需的包。 通过以上两种方法,您应该能够成功创建新的环境并解决"An HTTP error occurred when trying to retrieve this URL"的问题。希望对您有帮助!\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [解决:Anaconda创建虚拟环境出现An HTTP error occurred when trying to retrieve this URL.anaconda](https://blog.csdn.net/Lizi233/article/details/127328088)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Anaconda创建新环境失败解决方案](https://blog.csdn.net/jerry_rat/article/details/125111337)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值