Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/05/2012, 15:32
gandalf530
 
Fecha de Ingreso: mayo-2012
Mensajes: 1
Antigüedad: 12 años
Puntos: 0
Error creacion tabla con dos PK y una de ellas FK

Intento crear esta tabla en mi BD usando PHPMyAdmin y me sale este error:


Consulta:

Código:
create table periodo_abono( 
idPeriodoAbono int(11) NOT NULL auto_increment, 
precio int(5) NOT NULL , 
f_inicio date NOT NULL,
f_fin date default NULL,
idAbono int(11) NOT NULL,
constraint periodo_abono_pkey primary key (idAbono,idPeriodoAbono), 
constraint periodo_abono_fkey foreign key (idAbono) References abono(idAbono) 
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=1;
Error:
Código:
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key 
 
Y no se donde puede estar el error...