Does the mysql CLI tool provide a way to display binary data in a console-friendly manner?

Richard Simões picture Richard Simões · Mar 23, 2012 · Viewed 8.4k times · Source

I have a MySQL database containing a table with a binary-typed column. I'd like to be able to project that column without having to run it through, e.g., HEX(). Does the mysql CLI tool have a configuration option or other means to display a representation of binary data in a manner that won't output arbitrary bytes for my console to interpret in hilarious/annoying ways?

Answer

Pradeep picture Pradeep · Apr 9, 2018

Start MySQL CLI with param --binary-as-hex

Example:

mysql --binary-as-hex