MySQL Forums
Forum List  »  InnoDB

Re: errno: 150 - foreign key constraint was not correctly formed
Posted by:
Date: July 10, 2009 04:33AM

The solution was to add to the referenced 'create table' command 'COLLATE=utf8_unicode_ci' - so:

CREATE TABLE `permitSG` (
`tabA` varchar(30) NOT NULL default '',
`desc` varchar(255) default NULL,
PRIMARY KEY (`tabA`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

I've seen many posts regarding this common error with different specific solutions - the common answer appaears to be that both referenced and refererencing tables need to be as closely defined as possible.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: errno: 150 - foreign key constraint was not correctly formed
3215
July 10, 2009 04: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.