Thursday, May 23, 2013

Can't create table (errno: 121)


When Mysql can't create the table is usually due to FK.

1- make sure you have exact same date types between PK and FK (if you're using unsigned in PK, FK must be unsigned).

2- Check you're not already using same constraint name in the schema. Use info_schema to double check

select table_name, referenced_table_name, constraint_name  from information_schema.referential_constraints where constraint_schema='your_db'

No comments:

Post a Comment