Syntax error trying to insert SQL condition

I get 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?

Hello

Xavi

+4
source share
2 answers

Shouldn't it be ENGINE=InnoDB ?

+5
source

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 
+1
source

Source: https://habr.com/ru/post/1346957/


All Articles