给数据库某个字段增加索引

创建普通的索引
alter table table_name add index index_name (字段名)
创建主键索引
alter table table_name add primary key (字段名)
创建 唯一索引
alter table table_name add unique (字段名)
创建全文的索引
alter table table_name add fulltext (字段名)

alter table `user` add index `idx_username` (`username`);
alter table `user` add primary key (`id`);
alter table `user` add unique (`username`);
全部评论

相关推荐

LXXXXd:有点杂,想搞自动化的话没必要把法律的经历写上去
点赞 评论 收藏
分享
痛痛痛痛信灬:我小米都面完两个月了 八月底面完的,现在还是显示面试中,没有比我恐怖的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务