LoginSignup
6
10

More than 3 years have passed since last update.

[MySQL]オートインクリメント確認・変更

Last updated at Posted at 2017-03-08

オートインクリメントの確認と変更方法
頻繁にやることではなく、忘れやすいのでメモ

オートインクリメント確認

SHOW TABLE STATUS LIKE 'テーブル名';

または

SHOW TABLE STATUS where name = 'テーブル名';

オートインクリメント変更

ALTER TABLE `テーブル名` AUTO_INCREMENT = @new_autoincriment;

@new_autoincrimentはint型

Tips

書き込み権限のあるユーザーで実行可能です

6
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
10