0

I have some short pieces of binary data( max 130 bytes), what is the best way to store the same in mysql db. The first thing comes in mind is VARBINARY, BLOB but again what's wrong if I simply do base64-encoding and store the resulting string as a VARCHAR.

Vivek Giri
  • 465
  • 1
  • 6
  • 21
  • Similar to [this question](http://stackoverflow.com/questions/6395257/storing-image-as-base64string-varcharmax-or-varbinary). – lonesomeday Nov 01 '13 at 10:37

2 Answers2

0

I also facing the problem as you now had..

try longblob datatype. It will allow to store upto 4 mb i hope so..

Prabu
  • 21
  • 6
0

what's wrong if I simply do base64-encoding

There's a 33% overhead (i.e. you need at least 174 bytes to store the data) and searching becomes more difficult. OTOH it may make writing queries in SQL simpler.

symcbean
  • 47,736
  • 6
  • 59
  • 94