Search for value within BLOB column in MySQL

33,238

You should be able to search blobs like other text fields:

SELECT * 
FROM tablename 
WHERE blob_field_name LIKE '%value%'

One thing to notice is that search will be case-sensitive!

Anyway, if possible, it's better to use a TEXT field.

Share:
33,238

Related videos on Youtube

Zamblek
Author by

Zamblek

Updated on July 09, 2022

Comments

  • Zamblek
    Zamblek almost 2 years

    How can I search inside Blob column in MySQL for some values ? and Is that possible ?

  • Zamblek
    Zamblek over 13 years
    Thanks a lot, plus I have to use BLOB not TEXT
  • zzapper
    zzapper almost 9 years
    Just to emphasize when you "Like" search a Blob the search is case sensitive so LIKE '%fred%' is different to LIKE '%Fred%' .
  • JBS
    JBS almost 6 years
    Why is it better to use TEXT? Is BLOB slower to interact with?