Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I directly view blobs in MySQL Workbench

I'm using MySQL Workbench CE 5.2.30 CE / Rev 6790 . When execute the following statement:

SELECT OLD_PASSWORD("test") 

I only get back a nice BLOB icon, I need to left-click to select the cell, right-click and choose "Open Value in viewer" and select the "Text" tab.

Using the same with phpMyAdmin, I get directly back the value of the OLD_PASSWORD call. It's just an example, but is there a way to directly see such results in the output?

like image 625
mark Avatar asked Dec 03 '10 09:12

mark


People also ask

How do I view data in MySQL Workbench?

To view the database created on MySQL Workbench, navigate to Database > Connect to Database . Choose an existing connection to connect to MySQL Server or create a new one. The database created will be as shown in the screenshot below.

How do I read a BLOB file?

To read the blob data, you could create Data URLs for the image blob object instead. Data URLs prefixed with the data: scheme and data encoded into base64 format. Then in UWP the base64 data could be converted to image source.


2 Answers

In short:

  1. Go to Edit > Preferences
  2. Choose SQL Editor
  3. Under SQL Execution, check Treat BINARY/VARBINARY as nonbinary character string
  4. Restart MySQL Workbench (you will not be prompted or informed of this requirement).

In MySQL Workbench 6.0+

  1. Go to Edit > Preferences
  2. Choose SQL Queries
  3. Under Query Results, check Treat BINARY/VARBINARY as nonbinary character string
  4. It's not mandatory to restart MySQL Workbench (you will not be prompted or informed of this requirement).*

With this setting you will be able to concatenate fields without getting blobs.

I think this applies to versions 5.2.22 and later and is the result of this MySQL bug.

Disclaimer: I don't know what the downside of this setting is - maybe when you are selecting BINARY/VARBINARY values you will see it as plain text which may be misleading and/or maybe it will hinder performance if they are large enough?

like image 72
spioter Avatar answered Sep 20 '22 17:09

spioter


I'm not sure if this answers the question but if if you right click on the "blob" icon in the field (when viewing the table) there is an option to "Open Value in Editor". One of the tabs lets you view the blob. This is in ver. 5.2.34

like image 38
Dan Sherman Avatar answered Sep 24 '22 17:09

Dan Sherman