content_image/858225.jpg content_image/858226.jpg
mysql> SELECT CHAR(0x41), UNHEX(’41’); 

<img src='content_image/858225.jpg'>

• --binary-as-hex  enabled: 

mysql> SELECT CHAR(0x41), UNHEX(’41’); 

<img src='content_image/858226.jpg'>

To write a binary string expression so that it displays as a character string regardless of whether -- binary-as-hex  is enabled, use these techniques: 

•The CHAR()  function has a USING charset  clause: 

mysql> SELECT CHAR(0x41 USING utf8mb4); +--------------------------+ | CHAR(0x41 USING utf8mb4) | +--------------------------+ | A | +--------------------------+ 

•More generally, use CONVERT()  to convert an expression to a given character set: 

mysql> SELECT CONVERT(UNHEX(’41’) USING utf8mb4); +------------------------------------+ | CONVERT(UNHEX(’41’) USING utf8mb4) | +------------------------------------+ | A | +------------------------------------+ 

As of MySQL 8.0.19, when mysql  operates in interactive mode, this option is enabled by default. In addition, output from the status  (or \s ) command includes this line when the option is enabled implicitly or explicitly: 

Binary data as: Hexadecimal 

To disable hexadecimal notation, use --skip-binary-as-hex 

• --binary-mode 

This option helps when processing mysqlbinlog  output that may contain BLOB  values. By default, mysql  translates \r
  in statement strings to 
  and interprets \0  as the statement terminator. -- binary-mode  disables both features. It also disables all mysql  commands except charset  and delimiter  in noninteractive mode (for input piped to mysql  or loaded using the source  command). 

• --bind-address= ip_address 

On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server. 

• --character-sets-dir= dir_name 

The directory where character sets are installed. See Section 10.15, “Character Set Configuration” . 

