From: Date: February 20 2007 11:53pm Subject: Re: Alter table - adding constraints? List-Archive: http://lists.mysql.com/mysql/205116 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable 1) both tables are InnoDB. 2) both tables have data in them. 3) both table are the exact same data types. On 2/20/07 3:51 PM, "Chris White" wrote: > Jay Paulson wrote: >> I really don=B9t know what to do because I keep getting this error. Any >> ideas? >>=20 >> SQL query: >>=20 >> ALTER TABLE pl_reports ADD CONSTRAINT fk_region FOREIGN KEY ( region ) >> REFERENCES Region( id ) ON UPDATE CASCADE ON DELETE CASCADE >>=20 >> MySQL said: Documentation >> #1005 - Can't create table './survey_localhost/#sql-113_f8.frm' (errno: = 150) >>=20 >> Thanks! >>=20 >> =20 > 1) Are both tables InnoDB? > 2) Do you have data in either tables? > 3) Are the data types of both columns exactly the same ( int(20) > unsigned and int(20) will fail, the unsigned has to be there)? >=20 > you can also run SHOW INNODB STATUS as root to find out exactly what the > error is.