創建索引利用create index
create [unique|fulltext|spatial] index index_name [using index_type] on tbl_name (index_col_name,...) index_col_name: col_name [(length)] [asc | desc]
刪除索引利用drop index
drop index 索引名
好了下面我們先來看一款創建索引的簡單實例
create index part_of_name on customer (name(10));
刪除索引
drop index part_of_name on customer (name(10));
其中有一個全文索引fulltext索引只能對char, varchar和text列編制索引,並且只能在myisam表中編制