MySQL Error 1170 (42000): BLOB/TEXT Column 'userid' Used in Key Specification Without a Key Length0
tqvrhhv1j2013.09.24浏览181次分享举报
.........................
);
/*==============================================================*/
/* Table: user */
/*==============================================================*/
create table user
(
userid int not null,
username varchar(20) not null,
password varchar(20) not null,
sex varchar(4),
age int,
primary key (userid)
);
alter table book add constraint FK_Relationship_4 foreign key (catalogid)
references catalog (catalogid) on delete restrict on update restrict;
alter table orderitem add constraint FK_Relationship_2 foreign key (orderid)
references orders (orderid) on delete restrict on update restrict;
alter table orderitem add constraint FK_Relationship_3 foreign key (bookid)
references book (bookid) on delete restrict on update restrict;
alter table orders add constraint FK_Relationship_1 foreign key (userid)
references user (userid) on delete restrict on update restrict;
导入到MYSQL里就抛出:MySQL Error 1170 (42000): BLOB/TEXT Column 'userid' Used in Key Specification Without a Key Length
解决了这个错误多给20分!