mysql error 'TYPE=MyISAM'

巧了我就是萌 提交于 2019-11-26 13:47:59

问题


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

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

Can anyone suggest what's wrong?


回答1:


Replace

TYPE=MyISAM

with

ENGINE=MyISAM

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




回答2:


Do not use the keyword TYPE anymore. Use ENGINE instead.

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

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



回答3:


In newer MySQL Versions its:

ENGINE=MyISAM

here the tutorial (MySQL)




回答4:


Use ENGINE instead of TYPE

ENGINE = MYISAM ;


来源:https://stackoverflow.com/questions/11471075/mysql-error-type-myisam

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!