Re: ERROR 1005: Can't create table (errno: 150) [SOLVED]
Posted by:
Chris Walker ()
Date: June 28, 2009 12:41PM
Using the following:
CREATE TABLE `skills` ( `id` int(10) unsigned zerofill NOT NULL auto_increment, `HTML` ENUM ('0','1','2','3','4','5'), `FK_UID` int(10) NOT NULL, INDEX (FK_UID), FOREIGN KEY (FK_UID) REFERENCES `users` (`id`), PRIMARY KEY (`id`)) ENGINE=InnoDB;
I kept getting ERROR 1005 (HY000): Can't create table './sociallydeveloping/skills.frm' (errno: 150)
I managed to fix the problem by adding unsigned zerofill when defining `FK_UID`, I now have a referenced table! Perhaps it requires the column as FK to be the same column type as the table being referenced.