php mysql 错误 'TYPE=MyISAM'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11471075/
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-25 00:35:27  来源:igfitidea点击:

mysql error 'TYPE=MyISAM'

phpmysqlsyntax-errormyisam

提问by Aditya P Bhatt

Below query I'm executing in Ubuntu 12, MySQL 5.1 version and receiving error as mentioned:

下面的查询我在 Ubuntu 12、MySQL 5.1 版本中执行并收到如上所述的错误:

CREATE TABLE mantis_config_table (
    config_id VARCHAR(64) NOT NULL,
    project_id INTEGER NOT NULL DEFAULT 0,
    user_id INTEGER NOT NULL DEFAULT 0,
    access_reqd INTEGER DEFAULT 0,
    type INTEGER DEFAULT 90,
    value LONGTEXT NOT NULL,
    PRIMARY KEY (config_id, project_id, user_id)
) TYPE=MyISAM;

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' at line 9

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

Can anyone suggest what's wrong?

任何人都可以提出什么问题吗?

回答by Aditya P Bhatt

Replace

代替

TYPE=MyISAM

TYPE=MyISAM

with

ENGINE=MyISAM

ENGINE=MyISAM

The problem was "TYPE=MyISAM" which should be "ENGINE=MyISAM" as per MySQL version updates - a simple search / replace has fix it.

问题是“TYPE=MyISAM”,根据 MySQL 版本更新,它应该是“ENGINE=MyISAM”——一个简单的搜索/替换已经修复了它。

回答by juergen d

Do not use the keyword TYPEanymore. Use ENGINEinstead.

不要再使用关键字TYPE了。使用ENGINE来代替。

TYPE keyword is depreciated (since 5.0) and not supported in MySQL5.5

TYPE 关键字已贬值(自 5.0 起)且 MySQL5.5 不支持

CREATE TABLE mantis_config_table 
( 
   ...   
) 
ENGINE = MyISAM;
^^^^^^--------------------- HERE

回答by René H?hle

In newer MySQL Versions its:

在较新的 MySQL 版本中:

ENGINE=MyISAM

here the tutorial (MySQL)

这里的教程(MySQL)

回答by Besnik

Use ENGINE instead of TYPE

使用 ENGINE 而不是 TYPE

ENGINE = MYISAM ;