Bug #90947 "show create user" and "create user" to work with hex strings for auth data
Submitted: 21 May 2018 5:59 Modified: 22 Mar 2019 16:33
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S4 (Feature request)
Version:8.0.11 OS:Any
Assigned to: CPU Architecture:Any

[21 May 2018 5:59] Shane Bester
Description:
The request is to avoid these unprintable characters as they cause problems on some terminals and environments.

mysql> create user user1@'%' identified by '123456';
Query OK, 0 rows affected (0.04 sec)

mysql> show create user user1@'%';
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| CREATE USER for user1@%                                                                                                                                                                                                                                  |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| CREATE USER 'user1'@'%' IDENTIFIED WITH 'caching_sha2_password' AS '$A$005$i←#ZIgw§♫tY?re↓↨yr#↔o4mKTvyiTIruSORWqUh5Q0u5BMiwr.BxWCnReq155t8' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

How to repeat:
create user user1@'%' identified by '123456';
show create user user1@'%';

Suggested fix:
can CREATE USER take a hex string [0-9A-F] for the IDENTIFIED WITH clause, and can SHOW CREATE USER output the that?
[22 Mar 2019 16:33] Paul DuBois
Fixed in 8.0.17.

Password hash values displayed in the IDENTIFIED WITH clause of
output from SHOW CREATE USER may contain unprintable characters that
have adverse effects on terminal displays and in other environments.
Enabling the new print_identified_with_as_hex system variable causes
SHOW CREATE USER to display such hash values as hexadecimal strings
rather than as regular string literals. Hash values that do not
contain unprintable characters still display as regular string
literals, even with this variable enabled. For compatibility with
this change, CREATE USER and ALTER USER now accept hash values
specified either as regular string literals or as hexadecimal
strings.