-5

I get an error from MySQL:

#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=7 AUTO_INCREMENT=7' at line 6

My SQL is:

CREATE TABLE IF NOT EXISTS `default_setup_academic` (
  `academic_id` bigint(20) NOT NULL auto_increment,
  `academic_name` text NOT NULL,
  `academic_order` bigint(20) NOT NULL,
  PRIMARY KEY  (`academic_id`)
) TYPE=MyISAM AUTO_INCREMENT=7 AUTO_INCREMENT=7 ;

Why does that have an error?

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
  • You have `AUTO_INCREMENT=7` two times, remove one and should work – Sal00m May 08 '14 at 10:09
  • 1
    replace TYPE=MyISAM with ENGINE=MyISAM and remove one AUTO_INCREMENT – avisheks May 08 '14 at 10:12
  • 2
    Please take the time to format your question reasonably. When you were asking your question, there was a bit orange **How to Format** box to the right telling you how to do it. There was a preview area underneath to show you how it would look. There was an entire toolbar above the text box with all kinds of useful formatting buttons. – T.J. Crowder May 08 '14 at 10:13

2 Answers2

0

TYPE is no longer in use.

Go with ENGINE

ENGINE=MyISAM
Ravinder Reddy
  • 23,692
  • 6
  • 52
  • 82
0

2 issues You have AUTO_INCREMENT=7 2 times and change the type to ENGINE

 CREATE TABLE IF NOT EXISTS 
    default_setup_academic 
    ( 
      academic_id bigint(20) NOT NULL auto_increment, 
      academic_name text NOT NULL, 
      academic_order bigint(20) NOT NULL, 
      PRIMARY KEY (academic_id) 
    ) ENGINE=MyISAM AUTO_INCREMENT=7 ;
Abhik Chakraborty
  • 44,654
  • 6
  • 52
  • 63