William
William

Reputation: 1033

DB Error on create - Errno 150

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...)

Upvotes: 1

Views: 630

Answers (2)

Marc B
Marc B

Reputation: 360702

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.

Upvotes: 5

Haim Evgi
Haim Evgi

Reputation: 125496

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

Upvotes: 3

Related Questions