Syntax:
BINARY expr

The BINARY operator converts the expression to a binary string (a
string that has the binary character set and binary collation). A
common use for BINARY is to force a character string comparison to be
done byte by byte using numeric byte values rather than character by
character. The BINARY operator also causes trailing spaces in
comparisons to be significant. For information about the differences
between the binary collation of the binary character set and the _bin
collations of nonbinary character sets, see
https://dev.mysql.com/doc/refman/8.0/en/charset-binary-collations.html.

The BINARY operator is deprecated as of MySQL 8.0.27, and you should
expect its removal in a future version of MySQL. Use CAST(... AS
BINARY) instead.

URL: https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html

