Blobs and MySQL

Google
Submitted by Ravindra on Mon, 2008-10-27 01:46.

Since I came across this issue several times I thought of blogging about it to save my time and to help any one who might need this advice.

MySQL by default has a row size limit of 64K as at MySQL 5.0. Therefore if you save a file larger than that anything after the max size will not be saved. So do not be surprised if you find the data that is saved to be corrupted.

Obvious solution to this would be to increase the MySQL max_allowed_packet variable to a very high size.

But a more elegant solution would be to break up the large file in to separate rows.Another advantage of this approach is you can read one chunk at a time and stream vs reading the
entire file in to memory.

http://www.dreamwerx.net/phpforum/?id=1

permalink