mysql设置非主键字段自增

思路:首先把字段设置为key,然后更改为自增;

例如:

alter table asynch_task ADD KEY comp_index (code);
alter table asynch_task modify code BIGINT(20) auto_increment; 

你可能感兴趣的:(mysql)