faqts : Communication : Telephone : Errors

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

137 of 226 people (61%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

Error 1005 cant create table ...... errno:150

Nov 21st, 2003 18:37
mike south, timster, http://mysql.us.themoes.org/doc/en/SEC447.html


What this means, probably, is that you tried to create or alter a table
with a foreign key constraint, but you didn't create an index on the
column before creating the foreign key constraint.  So you might have a
line like this in your create table statement:

  foreign key (segment_id) references segment(id), 

and what you need to do is create an index on segment_id first.  So put
a line like the following BEFORE the foreign key line:

   key segment_part_segment_id (segment_id), 

That is, it would look like this:

   key segment_part_segment_id (segment_id), 
   foreign key (segment_id) references segment(id),