修改mysql表的字段为自增长

时间:2022-05-09 15:05:52

Alter table tb change id id int(10) not null auto_increment=1;//有问题

mysql> alter table newcar change id id int(11) not null auto-increment;//有问题

mysql> alter table newcar change id id int(11) not null AUTO_INCREMENT=1;//有问题

修改:alter table newcar change id id int(11) not null AUTO_INCREMENT;

 

删除

Alter table tb change id id int(10);//删除自增长

Alter table tb drop primary key;//删除主建