Is mysql auto increment safe to use as userID?

后端 未结 5 1251
刺人心
刺人心 2021-01-04 14:54

I am working on website that allows people to create profiles online. I was wondering if it is the right choice to use MySQL AUTO_INCREMENTed IDs as my user ids

5条回答
  •  感情败类
    2021-01-04 15:26

    Yes If you delete a row say with id 7 the next value of auto increment will be 8 and not 7 again. So all the values will definitely be unique. and you will need to truncate the table to start the auto increment again. SO you can always use auto increment fields for user IDS.

提交回复
热议问题