Deep
Deep

Reputation: 66

Mysql : foreign key error

I am using mysql version 5.5. I have two tables and i am tying to add foreign key constarint but somehow i keep getting this error that-:

Query I'm executing:

alter table ptcact add foreign key(ptcid) references ptccitation(ptcid);

Error I'm receiving:

ERROR 1005 (HY000): Can't create table 'ptc_journal.#sql-496_34' (errno: 150)

My tables:

  1. ptccitaion with ptcid as primary key with storage engine = MyIsam
  2. ptcact with storage engine=InnoDB

Upvotes: 1

Views: 60

Answers (1)

abeyaz
abeyaz

Reputation: 3164

MyISAM doesnt support foreign keys.

See mysql docs

Upvotes: 1

Related Questions