Search code examples
mysqldatabasedatabase-designcreate-table

A primary key's issue in mysql


While creating a table it automatically sets the int type column primary key. I don't know why.

create table CongViec
(
    ID_VT int not null,
    TenVT text,
    loaiVT text,
    donvt text,
    tinhtrang text, 
    xuatxu text, 
    soluongton int,
    minhhoa text,
    ghichu text,
    primary key (ID_VT)
) engine=csv

Too many keys specified; max 0 keys allowed


Solution

  • Just remove engine=csv thats it

    create table CongViec(
    ID_VT int not null,
    TenVT text,
    loaiVT text,
    donvt text,
    tinhtrang text, 
    xuatxu text, 
    soluongton int,
    inhhoa text,
    ghichu text,
    primary key (ID_VT)
    );
    

    See here