store binary data mysql

874 Views Asked by At

I want to store igbinary binary serialize data into MySQL. To improve performance is better to use TEXT or BLOB, or etc.

2

There are 2 best solutions below

0
On BEST ANSWER

When I need to store binary data I always use VARBINARY format.

You can find documentation here

If you are asking what are advantagese, please look here

0
On

You should use BLOB, as BLOB stands for Binary Large OBject, if you start storing binary data as text you could start to see all sorts of unexpected results.

There is some documentation explaining the datatypes: http://dev.mysql.com/doc/refman/5.0/en/blob.html

If you really want to store as text, Base64 encoding is what you need to look into, some more details here:

What is base 64 encoding used for?