MySQL – auto_incrementの初期値設定

今回は、auto_incrementの初期値設定について見ていきたいと思います。

使い方

使うにはalter tableを利用します。

alter table テーブル名 auto_increment=初期値;

例えば、「sample_table」のauto_incrementの初期値を100にしたい場合は、以下となります。

alter table sample_table auto_increment=100;

コメントを残す