MySQL: why varchar(254) and not varchar(255)?

database, mysql, varchar

Solution

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

Problem

Why do so many developers set varchar to 254 and not 255 when creating MySQL tables? Proof that this happens: mysql varchar 254

Original source