Understanding MySQL Foreign Key Error 1005
When creating a foreign key constraint, MySQL encounters an error 1005 accompanied by an "errno 150" message. This error typically arises when the referenced table lacks a usable index that aligns with the referenced columns.
Answering Your Questions:
CREATE INDEX idx_immobile ON dbimmobili.Immobile (ComuneImmobile, ViaImmobile, CivicoImmobile, InternoImmobile);
The above is the detailed content of Why Am I Getting MySQL Foreign Key Error 1005 (errno 150)?. For more information, please follow other related articles on the PHP Chinese website!