Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Now I am about to launch a site and I have trouble coming up with a way to create long user id(e.g. 4000002).

Do I set id to auto-increment(Starts at 0) and then add something(e.g. 4000000) to this id and put this new number in a new column in my table?

Does any body have a better practice to achieve this?

Thanks in advance!

share|improve this question
up vote 0 down vote accepted

Why not just set the auto_increment to 4000000 and let it count from there?


Also, make sure your id column can fit large numbers (bigint or similar)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.