DROP USER can't drop users with legacy upper case host name anymore

Bug #1002404 reported by Hartmut Holzgraefe
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server

Bug Description

As DROP USER lowercases the host name part of the user name now (see MySQL bug http://bugs.mysql.com/36742) it is not possible to drop users with host names with upper case letters in them (either from pre-5.1.53 installations or due to bug #1002404)

Such users either need to be removed by either removing them from the mysql.user table using DELETE or by first converting the host name part in mysql.user to all lower case using UPDATE and LOWER

(See also MySQL bug htt://bugs.mysql.com/61525)

How to repeat:
(assuming that bug #1002404 has not been fixed yet)

on the shell do

  hostname FOOBAR

in the mysql command line client

  SELECT User, Hostname FROM mysql.user WHERE Host = 'FOOBAR';

  DROP USER 'root'@'FOOBAR';

  SELECT User, Hostname FROM mysql.user WHERE Host = 'FOOBAR';

the DROP will report "0 rows affected" and both SELECTs will return the same result, proving that no user was deleted by the DROP statement

Suggested fix:
Make DROP USER really case insensitive regarding to the host name part

Related branches

Revision history for this message
Hartmut Holzgraefe (hartmut-php) wrote :

Alternative fix: let mysl_upgrade take care of converting all mysql.*.Host column contents to lowercase

description: updated
description: updated
Elena Stepanova (elenst)
tags: added: upstream
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.