Database encoding set to UTF8
The UTF8 character can take up to 3 bytes in MySQL , so 767 bytes is 255 .
Creating a UNIQUE index for such long text fields is not recommended.
Create a simple prefix index instead
CREATE INDEX ix_newsgroup_name ON newsgroup (name (30))
which is enough for prefix searches and add another column to store the MD5 hash, which will ensure uniqueness.
source share