对已生成的表追加主键 我们要做追加主键。 正确写法: alter table table_name add column id int primary key auto_increment not null; 注意:id后应紧跟int(属性) 生成的主键在最后的位置,自己调整下顺序