I'm using MySQL 5 with InnoDB tables. I'm trying to create a foreign key,
but when I try, it's giving me an error. I've tried this with the
MySQLQuery Browser, and EMS SQL Manager 2005. I get the following error in
the Query Browser:
Error while executing query.
ALTER TABLE
Jesse, a stab in the dark here, with some info from the manual.
A foreign key constraint is in My Code erroneously coded,
If MySQL gives the error number 1005 from a CREATE TABLE
statement, and the error message string refers to errno 150, then
the table creation failed because a foreign key
Is it possible you're in the wrong database (different from
'custtournaments') when you issue this command?
No. I've tried in SQL Browser, EMS SQL Manager, and MySQL Command line,
making sure in each case that I have the karate database selected. I have
also re-typed it in MySQL Command
On Wednesday 19 July 2006 10:25 am, Jesse wrote:
MySQL Error Number 1005
Can't create table '.\karate\#sql-304_9.frm' (errno: 150)
KEY `FK_custpoints_1` (`CTID`)
REFERENCES `custtournaments` (`ID`)
can you show us the column declarations for these two?
Any idea why this is happening, and
[EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Wednesday, July 19, 2006 2:33 PM
Subject: Re: Error when creating Foreign Key
On Wednesday 19 July 2006 10:25 am, Jesse wrote:
MySQL Error Number 1005
Can't create table '.\karate\#sql-304_9.frm' (errno: 150)
KEY `FK_custpoints_1` (`CTID
On Wednesday 19 July 2006 01:07 pm, Jesse wrote:
`ID` int(10) unsigned NOT NULL auto_increment,
`CTID` int(11) NOT NULL,
the storage types aren't the same. change CTID to INT(10) UNSIGNED NOT NULL
and it should work.
--
Chris White
PHP Programmer/DBank
Interfuel
--
MySQL General