cjhaas.com Basically a place that Chris can post solutions to problems so he can easily find them later

December 1, 2009

Fixing MySql “Can’t create table (errno: 150)”

Filed under: Uncategorized — Tags: — Chris Haas @ 2:15 pm

I got this while trying to create a foreign key in MySql. Once you see the fix its obvious. My parent table’s primary key was declared as UNSIGNED while my child table wasn’t. Change one or the other to match and you’re all set. I really which the MySql people would sit down and take a moment to write out better error messages. Something as simple as “datatypes must match” would have really helped me.

Powered by WordPress