Could someone please help me #1005 - Can't create table '.\iolcat\user.frm' (errno: 150) : CREATE TABLE `iolcat`.`user` ( `user_id` INT NOT NULL AUTO_INCREMENT , `user_name` VARCHAR( 300 ) NOT NULL , `user_password` VARCHAR( 300 ) NOT NULL , `user_first` VARCHAR( 100 ) NOT NULL , `user_theme` VARCHAR( 100 ) NOT NULL , `role_id` TINYINT( 5 ) NOT NULL , `user_salt1` VARCHAR( 300 ) NOT NULL , `user_salt2` VARCHAR( 300 ) NOT NULL , `user_lastpassword` VARCHAR( 100 ) NOT NULL , `user_account_id` TINYINT( 5 ) NOT NULL , `user_notification` TINYINT( 2 ) NOT NULL DEFAULT '0', `user_expire_on` DATE NOT NULL , `user_banned` TINYINT( 2 ) NOT NULL DEFAULT '0', `user_banned_reason` VARCHAR( 300 ) NOT NULL , PRIMARY KEY ( `user_id` ) , FOREIGN KEY (user_account_id) REFERENCES user_account(user_account_id), FOREIGN KEY (role_id) REFERENCES role(role_id), UNIQUE ( `user_name` ) ) ENGINE = InnoDB May i know what problem ..
[root@admin~]# perror 150 MySQL error code 150: Foreign key constraint is incorrectly formed You need to pay some attention to these two lines: FOREIGN KEY (user_account_id) REFERENCES user_account(user_account_id), FOREIGN KEY (role_id) REFERENCES role(role_id),