List:General Discussion« Previous MessageNext Message »
From:Robert M (Bob) Bartis Date:July 2 2004 9:12pm
Subject:Error 1005 when adding a Foreign Key
View as plain text  
I recently added a column and Index to an existing table. I wanted to also add a Foreign
Key. I have done this before defining the commands outside MySQL and souring the file in
for new tables, but would prefer to not have to dump the current table just for the
modification. I tried to add one based on the users guide, see command/response below,
without success. Obviously I am missing something. Any suggestions?
 
 
mysql> alter table runload_list add foreign key (PlanName) references testplans
> (PlanName) on update cascade on delete restrict;
ERROR 1005: Can't create table './mydb/#sql-3ebd_430.frm' (errno: 150)

Robert M. Bartis 
Lucent Technologies ¢ 
Room HO 1C-413A (HO) / 1B-304 (WH) 
( 732.949.4565 (HO) / 973.386.7426 (WH)

* bartis@stripped 

 

Thread
Error 1005 when adding a Foreign KeyBob)2 Jul
  • Re: Error 1005 when adding a Foreign KeyJosh Chamas2 Jul
RE: Error 1005 when adding a Foreign KeyHéctor Maldonado2 Jul