下列数据类型可以存储二进制字符串。

表 1. Binary Large Object
Name Storage Size Description
BINARY The length of the binary string. Fixed-length binary string, with a length between 1 and 8300.
BLOB The actual binary string plus 1 byte if the binary string is less than 127 bytes, or 4 bytes if the binary string is 127 bytes or greater. Variable-length binary string
VARBINARY The length of the binary string Variable-length binary string, with a length between 1 and 8300.

二进制串是一个8位字节(或字节)的序列. 与字符串相比,二进制串有两点不同:首先,二进制串允许存放值为0的8位字节和其他无法打印显示的八位字节(定义的范围超过32-126)。第二,在二进制串上进行的操作实际是处理字节,与之相反的是对字符串的编码和处理取决于本地设置。