Why do so many developers set varchar to 254 and not 255 when creating MySQL tables?
Proof that this happens: mysql varchar 254
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
varchar fields require n+1 bytes for fields less than or equal to 255
and required n+2 bytes for fields > 255
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
It should be set to 255, I’m assuming developers think they will save an extra byte from 254, but 255 is the standard