Vivek Sethi Vivek Sethi - 4 months ago 21
MySQL Question

error 1005 (hy000) can't create table (errno 150) in mysql

mysql problem screenshot

As in screenshot, both the fields: cust_id in customer table and Store_ID in ShelfLocation table have the same signature, still I am not able to reference cust_id from Store_ID.
Any help?

Answer

This solved it for me: Add before first line:

SET FOREIGN_KEY_CHECKS = 0;

Add after last line:

SET FOREIGN_KEY_CHECKS = 1;
Comments