0

I have a question about mysql select field type of blob, when I select like "enter image description here" it's garbled but i use the navicat export sql like" enter image description here" I don't know what's type of like "0xFADE571FDC6C7ADBD94444D4562886F8874577843B8F34AF" data and I want to select blob field print data like "0xFADE571FDC6C7ADBD94444D4562886F8874577843B8F34AF" what should i do

jasondayee
  • 549
  • 4
  • 11
  • A) It's a binary field, so what do you expect? B) Please post plain text instead of huge, mostly empty screenshots. – tadman Nov 26 '16 at 04:37
  • @tadman I want to use sql like "select encryptedPassword from entry where id = 1 " to select binary field and display binary data like "0xFADE571FDC6C7ADBD94444D4562886F8874577843B8F34AF" I will make database backup – jasondayee Nov 26 '16 at 04:41
  • 1
    Have you tried `SELECT HEX(encryptedPassword)` instead? – tadman Nov 26 '16 at 05:40
  • thanks reminded @tadman – jasondayee Nov 26 '16 at 06:35

1 Answers1

2

BLOB is used for storing binary data.

TEXT maybe used to store strings.

INTEGER maybe used to store HEX values and then you may use HEX(hex_col) while printing it using select.

You may use BINARY to store hex and then use HEX(hex_col) while displaying the values.

Fiddle: Example

Refer:

Storing hexadecimal values as binary in MySQL and Hex literals

Community
  • 1
  • 1
Ani Menon
  • 27,209
  • 16
  • 105
  • 126
  • @jasondayee good to know it helped. You may [accept the answer](http://stackoverflow.com/help/someone-answers). – Ani Menon Nov 26 '16 at 16:53