Declaration
HEX(str)
Description
Converts a number or string str to a hexadecimal string, where each byte of each character in str is converted into two hexadecimal digits.
For numeric parameter N, UNHEX(N) is not the inverse operation of HEX(N). In this case, you can use CONV(HEX(N),16,10) instead.
Examples
obclient> SELECT HEX(255), HEX('abc');
+----------+------------+
| HEX(255) | HEX('abc') |
+----------+------------+
| FF | 616263 |
+----------+------------+
1 row in set