Home > Database > Mysql Tutorial > MYSQL如何添加索引_MySQL

MYSQL如何添加索引_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:38:23
Original
1053 people have browsed it

bitsCN.com


MYSQL如何添加索引

 

1.添加PRIMARY KEY(主键索引)

 

mysql>ALTER TABLE `table_name` ADD PRIMARY KEY ( `column` ) 

 

2.添加UNIQUE(唯一索引) 

 

mysql>ALTER TABLE `table_name` ADD UNIQUE ( 

 

`column` 

 

3.添加INDEX(普通索引) 

mysql>ALTER TABLE `table_name` ADD INDEX index_name ( `column` ) 

 

 

4.添加FULLTEXT(全文索引) 

mysql>ALTER TABLE `table_name` ADD FULLTEXT ( `column`) 

 

5.添加多列索引 

mysql>ALTER TABLE `table_name` ADD INDEX index_name ( `column1`, `column2`, `column3` )

 

bitsCN.com
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template