Convert a string or a number to a string in hexadecimal format with the HEX() function : hexadecimal « Data Types « MySQL Tutorial






mysql>
mysql> SELECT HEX('cat');
+------------+
| HEX('cat') |
+------------+
| 636174     |
+------------+
1 row in set (0.02 sec)

mysql>
mysql> SELECT 0x636174;
+----------+
| 0x636174 |
+----------+
| cat      |
+----------+
1 row in set (0.00 sec)

mysql>








10.13.hexadecimal
10.13.1.How 0x00-padding of BINARY values affects column value comparisons:
10.13.2.SELECT 0xa+0;
10.13.3.SELECT 0x5162766c;
10.13.4.The default type of a hexadecimal value is a string
10.13.5.Convert a string or a number to a string in hexadecimal format with the HEX() function