what should be lenght of email password username

password’ should be char(40) if you use SHA1 hashes.(Secure Hash Algorithm) How it is secure ? will check later .

email’… use 255, you cannot know how long someone’s email address is.

For the username I’d just use whatever your max username length is. 20 or 30 would probably be good.

Also, if you use UTF8 char field in an index, you have to be aware, that MySQL reserves 3 times more bytes that the actual character length of the field, preparing for the worst case (UTF8 might store certain characters on 3 bytes). This can also cause lack of memory.

Unicode transoformation format

a lengh of 30 for user names, 64 for passwords(legth of the hash) and 50 for email adresses).

References :

http://stackoverflow.com/questions/3022305/database-mysql-design-varchar-length-for-utf8-fields-1-password-2-username

http://en.wikipedia.org/wiki/SHA_hash_functions

http://en.wikipedia.org/wiki/UTF-8

http://stackoverflow.com/questions/247304/mysql-what-data-type-to-use-for-hashed-password-field-and-what-length

Advertisements

About rahul23134654

Hi, I am Rahul Meha , B.E. in (I.T.)
This entry was posted in Mysql. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s