| Mailing List | | Home | | MySQL General - General MySQL discussion | | MaxDB - Everything about MaxDB, formerly known as SAP DB | | MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP | | Java Help - Mostly related to the MySQL Connector/J driver | | ODBC - ODBC with the MySQL Connector/ODBC driver | | Perl - Perl support for MySQL with DBI and DBD::mysql | | MySQL++ - Programming with the C++ API to MySQL |
|
|
  | |  | mysql 5.0: ERROR 1005 (HY000) | mysql 5.0: ERROR 1005 (HY000) 2004-06-06 - By Michael Stassen
Back
saiph wrote:
> create database url;
> use url
>
> create table cath
> (
> name varchar(10) primary key,
> ) type=innodb;
>
> create table site
> (
> url varchar(40) primary key,
> aline varchar(40),
> cath varchar(10),
>
> constraint fk_cath foreign key(cath) references cath(name)
> on delete set null on update cascade
> ) type=innodb;
>
>
> ERROR 1005 (HY000): Can 't create table './url/site.frm ' (errno: 150)
>
> the perms are correct indeed without the constraint there are no problems.
You have to put an index on cath before you can use it as a foreign key.
See <
http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html
>.
Michael
--
MySQL General Mailing List
For list archives:
http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=mysql
@(protected)
|
|
 |