Tuesday, December 27, 2011

MySQL : Error 1005 : Can't create table (err no:150)

How to resolve this error:
Make sure your fields datatype match.
They both should have exactly the same datatype and length.
Eg. INT(4) Unsigned isn’t the same as INT(11)
Also make sure if you have data in the table, the foreign keys will not fail.
Eg. If you have an value in one table and not in the other table, it will fail.
This may be common knowledge to most of you but it might come in handy to someone else.

[via]If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

No comments:
Write comments