mySql error 1005 (errno: 150) solution
This mysql error occurs when creating a table with the InnoDB engine and is basically telling you that there is a “foreign key problem” with your schema.
The thing to check to fix this error is to make sure that your foreign key fields are of the same datatype as their source fields.
As an example, assume the main table is “people”, and the second table is “city”, and that you want the field “cityID” in the “people” table to relate to the “cityID” field in the “city” table. Make sure that both “cityID” fields are the same datatype (in this case INT).
Hope this helps.