时间:2021-07-01 10:21:17 帮助过:84人阅读
ALTER TABLE `table_name` ADD PRIMARY KEY ( `column` )
‘table_name‘ 表名
column 字段
将table_name表的column字段设置为主键
ALTER TABLE `table_name` ADD UNIQUE ( `column` )
写法一:ALTER TABLE `table_name` ADD INDEX index_name ( `column` )
写法二:CREATE INDEX index_name ON `table_name`(`column1`,`column2`,`column3`)
ALTER TABLE `table_name` ADD FULLTEXT ( `column`)
写法一:ALTER TABLE `table_name` ADD INDEX index_name ( `column1`, `column2`, `column3` )
写法二:CREATE INDEX index_name ON `table_name`(`column1`,`column2`,`column3`)
SHOW INDEX FROM `table_name`;
DROP INDEX index_name ON `table_name`;
mysql 给表里的某个字段建立索引
标签:column 添加 联合 全文索引 alter 字段 unique 唯一索引 lte