How can I directly view blobs in MySQL Workbench

前端 未结 12 1834
一整个雨季
一整个雨季 2021-01-30 19:31

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

相关标签:
12条回答
  • 2021-01-30 20:02

    I pieced a few of the other posts together, as the workbench 'preferences' fix did not work for me. (WB 6.3)

    SELECT CAST(`column` AS CHAR(10000) CHARACTER SET utf8) FROM `table`;
    
    0 讨论(0)
  • 2021-01-30 20:05

    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?

    0 讨论(0)
  • 2021-01-30 20:05

    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

    0 讨论(0)
  • 2021-01-30 20:12

    had the same problem, according to the MySQL documentation, you can select a Substring of a BLOB:

    SELECT id, SUBSTRING(comment,1,2000) FROM t
    

    HTH, glissi

    0 讨论(0)
  • 2021-01-30 20:16
    select CONVERT((column_name) USING utf8) FROM table;
    

    In my case, Workbench does not work. so i used the above solution to show blob data as text.

    0 讨论(0)
  • 2021-01-30 20:17

    Doesn't seem to be possible I'm afraid, its listed as a bug in workbench: http://bugs.mysql.com/bug.php?id=50692 It would be very useful though!

    0 讨论(0)
提交回复
热议问题