Bug #100492 Create a clusteradmin account cannot specify hostname using mysql shell
Submitted: 11 Aug 9:26 Modified: 11 Aug 11:14
Reporter: Bin Hong (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Document Store: MySQL Shell Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[11 Aug 9:26] Bin Hong
Description:
mysqlsh -- dba configureInstance root@localhost:8021 --clusterAdmin='mgradmin@192.%' --clusterAdminPassword='mgradmin'
Configuring local MySQL instance listening at port 8021 for use in an InnoDB cluster...

This instance reports its own address as single-8021:8021

The instance 'single-8021:8021' is valid to be used in an InnoDB cluster.

ERROR: Dba.configureInstance: single-8021:8021: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '% WITH GRANT OPTION' at line 1

How to repeat:
mysqlsh -- dba configureInstance root@localhost:8021 --clusterAdmin='mgradmin@192.%' --clusterAdminPassword='mgradmin'

Suggested fix:

Allowing any host to access is a security risk, and hope to support specifying the host when creating a user using the mysql shell
[11 Aug 9:36] Bin Hong
If the clusteradmin parameter value contains ‘@’ use the host in the parameter, if it does not contain ‘@’ use % host
[11 Aug 11:14] MySQL Verification Team
Hello Bin Hong,

Thank you for the feature request!

regards,
Umesh