python怎么建立mysql数据库索引

使用python建立mysql数据库索引的方法

1.创建主键索引

方法一:

create table biao (

id int auto_increment primary key

)

方法二:

create table b (

id int auto_increment,

    primary key(id)

)

2.创建普通索引

方法一:

create table t3(

id int auto_increment primary key,

    name varchar(32) not null default '',

    index u_name(name)

)charset=utf8;

方法二:

create index ix_name on biao(name);

赞(0)
未经允许不得转载:主机测评网 » python怎么建立mysql数据库索引
分享到: 更多 (0)