How to add auto-increment to column in mysql database using phpmyadmin?

后端 未结 5 930
滥情空心
滥情空心 2020-12-30 10:17

I\'ve been trying to add auto-increment to one of my columns (basically an ID) but I can\'t find the auto-increment option for my column. Any idea where it is?

5条回答
  •  执笔经年
    2020-12-30 11:04

    This wont work if there are any foreign keys defined, and that is very likely for id fields.

    use:

    ALTER TABLE tablew_name CHANGE id id BIGINT(20) NOT NULL AUTO_INCREMENT;
    

    instead

提交回复
热议问题