Pergunta

When running the follow query i receive the error below, Im just trying to create this simple table with no FK or anything and still receive this error. What could be the cause? SQL query:

CREATE TABLE `xauction`.`orders` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`type` VARCHAR( 1 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = InnoDB;

MySQL said: Documentation

1005 - Can't create table 'xauction.orders' (errno: 150) (Details...)

Foi útil?

Solução

Try show innodb status. Within the big chunk of data it outputs, there's a section that'll have more details than the normal error message you get from the original error-causing query.

Outras dicas

the syntax is o.k

from mysql site :

. If the error message refers to error 150, table creation failed because a foreign key constraint was not correctly formed

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top