Pregunta

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 ?

¿Fue útil?

Solución 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.

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top