这完全取决于用于
picture列的列类型。根据您的需要,使用:
TINYBLOB
:最大长度为255个字节BLOB
:最大长度为65,535字节MEDIUMBLOB
:最大长度16,777,215字节LONGBLOB
:最大长度为4,294,967,295字节
请注意,如果您是通过JPA批注生成表的,则可以通过指定的
length属性来“控制” MySQL将使用的类型
Column,例如:
@Lob @Basic(fetch = FetchType.LAZY)@Column(length=100000)private byte[] picture;
根据
length,您将获得:
0 < length <= 255 --> `TINYBLOB` 255 < length <= 65535 --> `BLOB` 65535 < length <= 16777215 --> `MEDIUMBLOB`16777215 < length <= 2³¹-1 --> `LONGBLOB`



