Mysql byte array storage

2019-02-12 08:42发布

问题:

I have a byte array created in Java. It represents content of some file. I don't know exactly the maximum size of this array. It can be different sizes. I want to store it in mysql. What type should I use in mysql?

回答1:

Use BLOB, medium blob , varbinary

Mysql Choosing the Right Type for a Column



回答2:

Use varbinary to store byte arrays of arbitrary length in MySQL.



回答3:

use a blob field

java serialblob

mysql blob