Jul
29
2009

MySQL ERROR 1005 (HY000): Can’t create table ‘NameTable.frm’ (errno: 150)

This error 150 means “MySQL error code 150: Foreign key constraint is incorrectly formed”

So the common problem occurs if you try to create a new table with a foreign key without the table source FK (the source table doesn’t exist into DB ), the solution is create first the table source of the FK and then the another one.
or
Disable constraints check with:

SET FOREIGN_KEY_CHECKS = 0;

To enable check constraints

SET FOREIGN_KEY_CHECKS = 1;
Written by doutdex in: Base de Datos | Tags:

No Comments »

RSS feed for comments on this post. TrackBack URL


Leave a Reply

%d bloggers like this: