MySQL: Should my user ID be the initial key of an INT auto-increment, starting at 1?

I am starting a programmer by creating a non-profit website.

I need a user ID, and I thought it would be logical to use a simple INTEGER field with auto-increment for this. Does this make sense? The user ID will not be used directly by users (they will need to select a username); should I take care of where they start (supposedly 1)?

Any other recommendations I should use when creating the Users table?

Thank!

Jdelage

+3
source share
6 answers

. , . , 1, , , "" . ( , , , , , ).

, (, ). ( UNIQUE), .

:

  • , .

  • PK, , , , , , .

  • , .

+7

auto_increment . .
, . .

, . ? Auto_inqrement . , 98361, . , , , ( ..).

+3

, . 1, . 0 .

, , md5 ( ) - .

+1

, , Problably , , - , (md5) .

+1

, , , , .., .

+1

, , , , , id . . , id .

, , , id. , , , . , .

+1

Source: https://habr.com/ru/post/1768628/


All Articles