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

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


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

Example:

mysql --binary-as-hex


Set mysql client options in /etc/my.cnf works for me:

[client]binary-as-hex = true[mysql]binary-as-hex = true


Since you want to look at the table mostly for convenience, create a view:

CREATE OR REPLACE VIEW myview AS SELECT col1, HEX(col2) AS col2, col3, etc.... FROM table;

Then, all you have to do is reference myview instead of table:

SELECT * FROM myview;