MySQL Forums
Forum List  »  Newbie

Re: Alter table add foreign key causes can't create table error
Posted by: pia D'Alia
Date: December 20, 2013 10:33AM

Check that BOTH tables have the same ENGINE. For example if you have:

CREATE Table FOO ();
and:

CREATE Table BAR () ENGINE=INNODB;
If you try to create a constraint from table BAR to table FOO, it will not work on certain MySQL versions.

Fix the issue by following:

CREATE Table FOO () ENGINE=INNODB;

http://update9.com

Options: ReplyQuote


Subject
Written By
Posted
Re: Alter table add foreign key causes can't create table error
December 20, 2013 10:33AM


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.