PRI   primary key  表示主键,唯一    写法: id bigint(20) unsigned primary key not null  ,
uni UNIQUE 表示唯一 写法 id bigint(20) unsigned UNIQUE default NULL
mul 添加了索引 写法: alter table test add index suoyin (col_name1);
如果有同时存在,
显示顺序 PRI>UNI>MUL

添加索引:

        假设有数据库表playlist163,将其中的over字段里key 设为MUL

       mysql>alter table playlist163 add index(over);

MySQL的主键,索引设置和添加

MySQL的主键,索引设置和添加

相关文章:

  • 2021-11-05
  • 2022-12-23
  • 2021-11-30
  • 2021-06-19
  • 2021-09-15
  • 2021-08-17
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2021-09-15
  • 2022-02-12
  • 2021-12-04
  • 2021-12-29
相关资源
相似解决方案