altter table tbl_name drop id
alter table tbl_name add id int(5) not null auto_increment

解决方案 »

  1.   

    楼上大哥这是你答案,请是怎么回事!ERROR 1075: Incorrect table definition; There can only be one auto column and it
     must be defined as a key
      

  2.   

    奥对了,你要把它设置成自增的需要把id设为主键。如果你已经有主键了删除原先的逐渐在添加该列
    altter table tbl_name drop id
    alter table tbl_name add id int(5) not null auto_increment primary key