SQL general error 1005 and errno 150

SQLSTATE[HY000]: General error: 1005 Can’t create table ‘mydatabase.#sql-c7c_81e’ (errno: 150)

My issue was that the Foreign Key didn’t match the type of field I was trying to use as reference.

id (source) = int(10) – unsigned

foreign = int(11)

Foreign here needs to be unsigned as well to avoid this type of errors.

id (source) = int(10) – unsigned

foreign = int(10) – unsigned

← Back to home