MySQL Forums
Forum List  »  InnoDB

InnoDB foreign key: Can't create table './recruiter/#sql-307a_d.frm'
Posted by: Kyong Park
Date: May 12, 2005 01:10AM

attempting to execute a series of alter table statements to create foreign keys such as the following:

ALTER TABLE MYTABLE
ADD CONSTRAINT FK_M_OTHERTABLE
FOREIGN KEY (OTHERTABLE_ID)
REFERENCES OTHERTABLE (ID);

After creating tables and attempting to execute the above I get:
ERROR 1005 at line 3: Can't create table './mydatabase/#sql-307a_d.frm' (errno: 150)

1. OTHERTABLE_ID is a not null column
2. the ID column in OTHERTABLE is the primary key column.
3. Finally the script I'm running works fine on a suse system running MySQL 4.1. Trying this script on OpenBSD running mysql-server-4.0.20. Doing a show table status shows that the tables are in fact innodb. The innodb table type is not stated explicitly in the create table statements but through the default-table-type variable.

Anyone have any thoughts?

Options: ReplyQuote


Subject
Views
Written By
Posted
InnoDB foreign key: Can't create table './recruiter/#sql-307a_d.frm'
3882
May 12, 2005 01:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.