Bug #100437 Unable to create usernames that require escaping as in `otherwise invalid`
Submitted: 5 Aug 2020 18:23 Modified: 12 May 9:24
Reporter: David Greenwood Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL for Windows: Installer Severity:S3 (Non-critical)
Version:8 OS:Windows
Assigned to: CPU Architecture:Any

[5 Aug 2020 18:23] David Greenwood
Description:
When adding a new user to a MySQL instance in MySQL for Windows: Installer, it is not possible to escape a username containing characters that are otherwise invalid. 

There is seemingly no way to escape such a username, yet the MySQL grammar permits such usernames when they are escaped, e.g. 

CREATE USER `invalid-username-with-dashes`@`%` IDENTIFIED BY 'password';

The installer appears not to conform to the grammar in this instance.

How to repeat:
Run the installer and create a new MySQL instance. At the page where users can be added, bring up the dialog for adding a user. Type a username that would require escaping in SQL. Try to add the user. The installer does not permit it. Try to escape the invalid username using `` as in `something-invalid.` Again, the installer does not accept the input.

Suggested fix:
Allow use of `` around the username input.
[20 Aug 2020 11:13] MySQL Verification Team
Hello David Greenwood,

Thank you for the reasonable feature request.!

Regards,
Ashwini Patil
[9 May 15:58] Jose Ramirez Ruiz
Posted by developer:
 
Updated the Accounts and Roles configuration page and the CLI to support user names with special characters. This can be enabled by adding single quotes, double quotes or backticks as part of the user name.
[12 May 9:24] Edward Gilmore
Posted by developer:
 
 Added the following note to the MySQL Installer 1.6.15 release notes:
 
 It was not possible to create a username using special characters.

As of this release, you can define usernames with special characters 
by enclosing the username in single quotes ('), double quotes ("), or back ticks (`).