mysql error 'TYPE=MyISAM'

PhpMysqlSyntax ErrorMyisam

Php Problem Overview


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?

Php Solutions


Solution 1 - Php

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.

Solution 2 - Php

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

Solution 3 - Php

In newer MySQL Versions its:

ENGINE=MyISAM

here the tutorial (MySQL)

Solution 4 - Php

Use ENGINE instead of TYPE

ENGINE = MYISAM ;

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAditya P BhattView Question on Stackoverflow
Solution 1 - PhpAditya P BhattView Answer on Stackoverflow
Solution 2 - Phpjuergen dView Answer on Stackoverflow
Solution 3 - PhpRené HöhleView Answer on Stackoverflow
Solution 4 - PhpBesnikView Answer on Stackoverflow