开发者

Syntax error trying to insert an SQL clause [duplicate]

This question already has answers here: 1064 开发者_StackOverflow社区error in CREATE TABLE ... TYPE=MYISAM (5 answers) Closed 9 years ago.

I'm getting this error:

 CREATE TABLE `libro`
 (
 `id` INTEGER  NOT NULL AUTO_INCREMENT,
 `autor_id` INTEGER(11),
 `titulo` VARCHAR(255),
 `paginas` VARCHAR(255)  NOT NULL,
 PRIMARY KEY (`id`),
 INDEX `libro_FI_1` (`autor_id`),
 CONSTRAINT `libro_FK_1`
 FOREIGN KEY (`autor_id`)
 REFERENCES `autor` (`id`)
 )Type=InnoDB
[propel-sql-exec] SQLSTATE[42000]: Syntax error or access violation: 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=InnoDB' at line 12

Any idea?

Regards

Javi


Shouldn't it be ENGINE=InnoDB?


Use ENGINE instead of Type

 CREATE TABLE `libro`
 (
  `id` INTEGER  NOT NULL AUTO_INCREMENT,
  `autor_id` INTEGER(11),
  `titulo` VARCHAR(255),
  `paginas` VARCHAR(255)  NOT NULL,
  PRIMARY KEY (`id`),
  INDEX `libro_FI_1` (`autor_id`),
  CONSTRAINT `libro_FK_1`
  FOREIGN KEY (`autor_id`)
  REFERENCES `autor` (`id`)
 )ENGINE=InnoDB
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜