To whom faced kind of this error when creating foreign key like me ( forget the mysql ofr a while :p ) you can check the type of table filed you have already created, make sure the type of field is same, like using INT for both table you want connected using foreign key :p

continue reading.....