首页 > 数据库技术 > 详细

创建mysql索引的方式

时间:2019-12-19 01:20:45      阅读:116      评论:0      收藏:0      [点我收藏+]

创建索引方式:

1、create index 索引名   on 表名 (字段)

2、alter table 表  add index 索引名  (字段)

 

-- 普通索引
alter table 表名 add index 索引名 (字段) ;
-- 唯一索引
alter table 表名 add unique (字段) ;
-- 主键索引
alter table 表名 add primary key (字段) ;

 

删除索引:

 

drop index 索引名  on 表名

创建mysql索引的方式

原文:https://www.cnblogs.com/tanzhijian136/p/12064388.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!