51

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?

Nisse Engström
  • 4,738
  • 23
  • 27
  • 42
Aditya P Bhatt
  • 21,431
  • 18
  • 85
  • 104

5 Answers5

93

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.

Aditya P Bhatt
  • 21,431
  • 18
  • 85
  • 104
29

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
juergen d
  • 201,996
  • 37
  • 293
  • 362
15

In newer MySQL Versions its:

ENGINE=MyISAM

here the tutorial (MySQL)

René Höhle
  • 26,716
  • 22
  • 73
  • 82
7

Use ENGINE instead of TYPE

ENGINE = MYISAM ;
Besnik
  • 6,469
  • 1
  • 31
  • 33
0

in my case, fixed the issue by replacing the older dialect with newer one (compatible with the database):

old: spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect new:spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect

Jayant
  • 101
  • 1
  • 5