设置自增长:
alter table table1 add id int auto_increment primary key 自增字段,id一定要设置为primary key.
alter table users AUTO_INCREMENT=10000;
添加删除外键:
ALTER TABLE articles DROP FOREIGN KEY fk_member;
alter table tb_active add constraint FK_ID foreign key(user_id) REFERENCES tb_user(id)
alter table table1 add id int auto_increment primary key 自增字段,id一定要设置为primary key.
alter table users AUTO_INCREMENT=10000;
添加删除外键:
ALTER TABLE articles DROP FOREIGN KEY fk_member;
alter table tb_active add constraint FK_ID foreign key(user_id) REFERENCES tb_user(id)