mysql 中的错误 #1064

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9680349/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 12:29:36  来源:igfitidea点击:

Error #1064 in mysql

mysql

提问by Peyman Omidi

I keep getting this error:

我不断收到此错误:

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 'TYPE=MyISAM AUTO_INCREMENT=58' at line 11

1064 - 你的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 11 行的“TYPE=MyISAM AUTO_INCREMENT=58”附近使用正确的语法

This is my query :

这是我的查询:

CREATE TABLE `tbl_cart` (
`ct_id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`pd_id` int( 10 ) unsigned NOT NULL default '0',
`ct_qty` mediumint( 8 ) unsigned NOT NULL default '1',
`ct_session_id` char( 32 ) NOT NULL default '',
`ct_date` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY ( `ct_id` ) ,
KEY `pd_id` ( `pd_id` ) ,
KEY `ct_session_id` ( `ct_session_id` )
) TYPE = MYISAM AUTO_INCREMENT =58;

Help Me What the problem is ...

帮帮我这是什么问题...

回答by Joachim Isaksson

The keyword TYPEis removed since MySQL 5.1, use

TYPE从 MySQL 5.1 开始删除关键字,使用

) ENGINE = MYISAM AUTO_INCREMENT =58;

instead.

反而。

回答by juergen d

CREATE TABLE `tbl_cart` (
`ct_id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`pd_id` int( 10 ) unsigned NOT NULL default '0',
`ct_qty` mediumint( 8 ) unsigned NOT NULL default '1',
`ct_session_id` char( 32 ) NOT NULL default '',
`ct_date` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY ( `ct_id` ) ,
KEY `pd_id` ( `pd_id` ) ,
KEY `ct_session_id` ( `ct_session_id` )
) ENGINE  = MYISAM AUTO_INCREMENT =58;