문제

I am asked to store small files in a mysql database. They are limited to 150kb.

What data type is the most efficient to use? BINARY(150000), VARBINARY(150000) or MEDIUMBLOB ?

도움이 되었습니까?

해결책 2

Ok I got my answer so I share it here: since we finally wanted to use the column to store short texts (value of the message can be an embedded file or some text), I used mediumblob that consists of text. And any way on the web, I found references to blob rather than to binary types.

FYI the file is encoded in binary Base64 format.

다른 팁

Have you considered storing your files in a file system and in the database maybe storing only metadata such as relative path ? I think thats the right way

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top