MD5 function returns empty result

I am trying to return a MD5 encoded string of values ​​from my database, but it just returns an empty result (but not empty, just empty). I tried to execute this query and get the same result:

SELECT MD5('test'); 

I tried restarting the MySQL server, MySQL Workbench, etc. But get the same result. If I try to run the same command on a different database / server, it will return the hash string just fine.

What am I doing wrong? Is there a disabled setting during an accident?

+7
source share
1 answer

Prior to MySQL v5.5.3, MD5() returned a binary string.

By default, MySQL Workbench does not display binary strings (to avoid accidental misinterpretation); however, you can display binary string values ​​in the output grids: View> Edit> Preferences> SQL Editor> Treat BINARY/VARBINARY as a non-binary character string.

Alternatively, either upgrade your MySQL server or transcode the result into a non-character set of characters:

 SELECT CONVERT(MD5('test') USING utf8) 
+9
source

All Articles