Brian Dunning's Error Code Reference

MySQL Error 1005

SQLSTATE: HY000 (ER_CANT_CREATE_TABLE) Can't create table '%s' (errno: %d)

 

Comments

Shraddha   Shraddha, SolutionAnalysts
Aug 5, 2013
If you’re using referential integrity on MySQL, you can easily run into this error with the InnoDB engine. It frequently seems to occur with an ALTER TABLE statement. It can mean many things but typically it means the data types don’t match between the foreign key and primary key column. Likewise, it can mean one of the column data types disagrees in a multiple-column foreign to multiple-column primary key constraint.
 
derya   derya
Jul 7, 2010
MYSQL always gives this error while trying to add foreign keys.Isn't there an easy way to add foreign keys?