user3420800
user3420800

Reputation:

How to retrieve a stored image in MySQL Workbench

Workbench 6.0.2.

I have inserted the image using the following query:

create table images (ID int,Image BLOB);  
insert into images values (1,load_file('C:\Users\PEL_AY\Desktop\1.jpg') );

But the problem is how to view the image stored image database using load_file

Do I need a front-end to view the image?

Upvotes: 5

Views: 15166

Answers (1)

Mike Lischke
Mike Lischke

Reputation: 53307

You can embed image data just like any data in a MySQL table. For binary data you usually would use a BLOB column data type. MySQL Workbench has a built-in editor for binary data, which you can open via the result grid context menu:

enter image description here

This editor allows to view text, hex binary values and images (limited to those formats the platform can show, e.g. on Windows bmp, gif, png, jpg and a few more).

enter image description here

Upvotes: 9

Related Questions