1,创建索引
CREATE INDEX indexName ON mytable(username(length));
2,修改索引表结构
ALTER mytable ADD INDEX [indexName] ON (username(length))
3,删除索引的语法
DROP INDEX [indexName] ON mytable;
创建表的时候直接指定
CREATE TABLE mytable(
ID INT NOT NULL,
username VARCHAR(16) ‘www.hezhidz.com‘,
INDEX [indexName] (username(length))
);
mysql中普通索引增删改查
原文地址:https://www.cnblogs.com/96net/p/14903197.html