Better to use CHAR(32)
with latin1
charset, or BINARY(16)
if you want to save more spaces.
CREATE TABLE ... ( ... md5 CHAR(32) CHARACTER SET 'latin1' NOT NULL ...
MySQL uses utf8mb4
as default charset since 5.7, and CHAR(32)
with utf8mb4
takes 128 bytes, worse than VARCHAR(32)
.