Can anyone help me get around this error when trying to use user_id from PHPBB table phpbb_users as a foreign key in a new table? Here is my attempt to create the table... The error: ERROR 1005 (HY000): Can't create table 'forum.test_table' (errno: 150) And... the latest foreign key error... This error message is just over my head. What do I need to do to get this foreign key working?
Make sure the column data types match perfectly. int(11) is not int unsigned (11) etc. Make sure both tables use InnoDB storage. Make sure there is a unique index on phpbb_users (user_id). Make sure there isn't an existing foreign key violation in the user_id of the new table (wont be an issue if you're just creating it). Other than that, it should work.