DB Error on create - Errno 150
-
02-10-2019 - |
Question
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...)
Solution
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.
OTHER TIPS
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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow