Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
主键';mysql中的问题_Mysql_Database_Database Design_Data Structures - Fatal编程技术网

主键';mysql中的问题

主键';mysql中的问题,mysql,database,database-design,data-structures,Mysql,Database,Database Design,Data Structures,我是MySQl的新手。因此,我在创建表时遇到了主键问题。 它自动设置int-type列主键。我真的不知道为什么。 我尝试以下陈述: 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=c

我是MySQl的新手。因此,我在创建表时遇到了主键问题。 它自动设置int-type列主键。我真的不知道为什么。 我尝试以下陈述:

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
请给我一个建议/提示。
提前感谢。

CSV引擎不支持索引,包括主键


更多信息只需删除engine=csv即可

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)
);

使用engine=InnoDB而不是engine=csv,MySQL中没有csv引擎。

engine=csv
--您确定引擎吗?@sectus yes:AKAIK,
主键也会在指定列上创建
索引。而
CSV
引擎不支持
索引。
CSV
引擎有一些限制。