MySQL 创建索引
程序员文章站
2022-07-04 19:51:39
1.添加PRIMARY KEY(主键索引) alter table `table_name` add primary key ( `column` ) 2.添加UNIQUE(唯一索引) alter table `table_name` add unique ( `column` ) 3.添加INDE ......
1.添加PRIMARY KEY(主键索引)
alter table `table_name` add primary key ( `column` )
2.添加UNIQUE(唯一索引)
alter table `table_name` add unique ( `column` )
3.添加INDEX(普通索引)
alter table `table_name` add index index_name ( `column` )
4.添加FULLTEXT(全文索引)
alter table `table_name` add fulltext ( `column`)
5.添加多列索引
alter table `table_name` add index index_name ( `column1`, `column2`, `column3` )
推荐阅读