PDA

View Full Version : MySQL, questo sconociuto ... :(


fifth
07-04-2006, 18:42
Salve a tutti. Provando ad inserire delle tabelle nel mio database, mi sono scontrato su un odioso problema: mi permette di creare quasi tutto quello che voglio tranne che per 3 tabelle (le quali hanno tutte 2 vincoli di tipo foreign key, contro le altre tabelle che ne hanno uno solo) dicendomi:

"ERROR 1005 (HY000): Can't create table '.\ ... .frm' (errno: 150)"


...

qualcuno są darmi delucidazioni?
Grazie ;)

orpheus
07-04-2006, 18:50
Dal manuale di mysql

If MySQL reports an error number 1005 from a CREATE TABLE statement, and the error message refers to errno 150, table creation failed because a foreign key constraint was not correctly formed. Similarly, if an ALTER TABLE fails and it refers to errno 150, that means a foreign key definition would be incorrectly formed for the altered table. You can use SHOW ENGINE INNODB STATUS to display a detailed explanation of the most recent InnoDB foreign key error in the server.

Forse non hai dichiarato la tabella in questione di tipo InnoDB.