PRI主鍵約束; PRI primary key 表示主鍵,唯一 寫法: id bigint(20) unsigned primary key not null , UNI唯一約束; uni UNIQUE 表示唯一 寫法 id bigint(20) unsigned UNIQUE default NULL MUL可以重復。 mul 添加了索引 寫法: alter table test add index suoyin (col_name1);