Question

I am using Workbench for Mac When I trying to do select encrypt, I have no result in the field. If I copy the field I obtain tree dots "..."

I try the same thing with Query Browser and I have a result.

How to display this in workbench ?

select encrypt("mypassword")
Was it helpful?

Solution

ENCRYPT() returns a binary string.

By default, MySQL Workbench does not display binary strings (to avoid accidental misinterpretation); however it is possible to display binary string values in output grids: View > Edit > Preferences > SQL Editor > Treat BINARY/VARBINARY as nonbinary character string.

Alternatively, transcode the result to a non-binary string:

SELECT CONVERT(ENCRYPT('test') USING utf8)

Or encode it in a suitable fashion:

SELECT HEX(ENCRYPT('test'))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top