Oh my blob!

Published on and tagged with mysql  problem  tip

I never used blobs before with MySQL, and so I had to learn painful that there are several types of blobs available in MySQL: TINYBLOB, BLOB, MEDIUMBLOB and LONGBLOB.

And that is the way I had to learn it: In my app the user can upload files, and these files are stored in the database. Everything worked fine with small files. But for some reason it didn’t work with larger files. If I tried to download the uploaded files, the download was discontinued after a short time period. “Probably a timeout problem”, I thought. And so I searched in this area for the cause of the problem. Without result. By accident I landed on the page “Data Type Storage Requirements”, and I got the “Aha” effect. I used the wrong data type: “BLOB” supports only data up to 64kb…

Another learning from this episode is that the cause of a problem is sometimes not there where you are looking for…

10 comments baked

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License