Bug #69658 can not drop user that created by mysql_install_db if hostname contains upper
Submitted: 3 Jul 2013 9:39 Modified: 3 Jul 2013 11:42
Reporter: xiaobin lin (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S3 (Non-critical)
Version:5.1+ OS:Any
Assigned to: CPU Architecture:Any
Tags: drop user, upper case

[3 Jul 2013 9:39] xiaobin lin
Description:
Using the normal step mysql_install_db --defaults-file=my.cnf

After MySQL started, there are two some default users. If the hostname contains upper case character, there will be two users named ''@'myHost', 'root'@'myHost'.

Both of them can not be drop by "drop user" command.

The reason is that when mysql_install_db, the records are insert into mysql.user by "insert" statement.

So the raw named are filled.

But when run "drop user 'root'@myHost'" command, the hostname are changed lower case in the server-side. So an error is raised. There is no way to drop this user. Though "delete from mysql.user " can manage it, but it is not a standard operation.

How to repeat:
As above

Suggested fix:

./share/mysql_system_tables_data.sql
change 
set @current_hostname= @@hostname;
to
set @current_hostname= lower(@@hostname);
[3 Jul 2013 11:42] MySQL Verification Team
Thank you for the bug report, duplicate of Bug #62255
[3 Jul 2013 11:45] MySQL Verification Team
Also, see Bug #62254