# mysql添加索引

#普通索引  添加INDEX
ALTER TABLE `table_name` ADD INDEX index_name ( `column` )

#主键索引   添加PRIMARY KEY
ALTER TABLE `table_name` ADD PRIMARY KEY ( `column` )

#唯一索引    添加UNIQUE
ALTER TABLE `table_name` ADD UNIQUE ( `column` )

#全文索引    添加FULLTEXT
ALTER TABLE `table_name` ADD FULLTEXT ( `column`)

#如何添加多列索引
ALTER TABLE `table_name` ADD INDEX index_name ( `column1`, `column2`, `column3` )
1
2
3
4
5
6
7
8
9
10
11
12
13
14