Saturday 15 September 2012

mysql - Is it bad to use user name as primary key in database design? -


A friend told me:

Which unique keys do you use? I hope you are not saving the entire username --- it will use too much table space! Assign a unique user id for each (unique) username and secure this user id (must have uninstalled auto_interment or begun unsecured auto_trayment). Do not forget to make a reference

Use the usability ( user ID userID ) references >) User ID

Is the above description correct? I think that's right (for the wrong reason) because the primary key can not be changed

You can change the user name then you should use the userid because it will not change.


No comments:

Post a Comment