-1

Here is the code:

create table `team`.`User`( 
   `UserID` bigint NOT NULL AUTO_INCREMENT , 
   `Username` text(30) NOT NULL , 
   `Email` text(30) NOT NULL , 
   PRIMARY KEY (`UserID`)
 )  Engine= [default] comment='' row_format=Default  

And the error message:

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
'[default] comment='' row_format=Default' at line 6

Can someone tell me why I'm getting this error and how to fix it?

EDIT: This code was automatically generated by SQLyog. It seems that the Engine bit is causing the problem. Does anyone know how to use SQLyog to set the default engine?

Marco
  • 56,740
  • 14
  • 129
  • 152
Henry Henrinson
  • 5,203
  • 7
  • 44
  • 76
  • If you want to use the default engine then just leave that part from your create table statement. – juergen d Jul 05 '12 at 09:46
  • What did you not understand in `"check the manual that corresponds to your MySQL server version for the right syntax to use"`? – Romain Jul 05 '12 at 09:46
  • Please, don't change your question. You have many answers here that solve problem you posted. If you need, post another question, mentioning this question in it... – Marco Jul 05 '12 at 10:04

4 Answers4

2

If you want to use default engine you should try to remove Engine= [default] part.
Your query should be

CREATE TABLE `team`.`User`( 
   `UserID` BIGINT NOT NULL AUTO_INCREMENT , 
   `Username` TEXT(30) NOT NULL , 
   `Email` TEXT(30) NOT NULL , 
   PRIMARY KEY (`UserID`)
 )  comment='' 
Marco
  • 56,740
  • 14
  • 129
  • 152
1

Engine= [default], try with Engine= MyISAM, for example.

Ben
  • 51,770
  • 36
  • 127
  • 149
Clément Andraud
  • 9,103
  • 25
  • 80
  • 158
1

As far as I know, square brackets don't have any special meaning in MySQL. You're probably confused with some other DBMS.

Valid syntax for the ENGINE keyword is ENGINE [=] engine_name. E.g.:

ENGINE=InnoDB

... or

ENGINE InnoDB

If you don't care about the storage engine, remove the clause and MySQL will use the default.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
-1

Your create query is fault. Take a look at the manual and what is the correct syntax for ENGINE

donald123
  • 5,638
  • 3
  • 26
  • 23