Home > SQL, Tech > MySQL: Detailed Error Message for errno. 150

MySQL: Detailed Error Message for errno. 150


A quick note for errors due to failure on Foreign Key constraint in MySQL that spit out a common error:


Can't create table 'table_name'' (errno: 150)

There can be multiple reasons behind this error including type mismatch between the parent and child columns to this


You have defined a SET NULL condition though some of the
columns are defined as NOT NULL.

The detailed message however is not shown. To access the last such error message do this

mysql> show innodb status;

and look for LATEST FOREIGN KEY ERROR.

  1. February 21, 2010 at 7:03 pm

    Good fill someone in on and this mail helped me alot in my college assignement. Gratefulness you for your information.

  1. No trackbacks yet.

Leave a comment