Mysql 常用总结

1、自增列

只有int类型且为primary key 才可以使用auto_increment。且自增列的步长是针对实例设置的不能针对某个表设置

SHOW VARIABLES LIKE 'auto_inc%';

alter table album change ALBUM_ID ALBUM_ID bigint not null auto_increment;
alter table album auto_increment=1;

create table cc(id int auto_increment,name varchar(20),primary key(id));

原文地址:https://www.cnblogs.com/luck001221/p/4318498.html