Sign up ×


DROP User ''@'WOPR';


Query OK, 0 rows affected.

But when I put in


The return is:

| User | Host | Password |
|      | WOPR |          |

(WOPR is my hostname)

I run the command

DROP User ''@'WOPR';

and get the same result.


Does anyone know what can cause this behavior?

share|improve this question

migrated from Aug 14 '11 at 0:46



1 Answer 1

up vote 10 down vote accepted

This should do it for you.

Give it a Try !!!



Just do this

SELECT * FROM mysql.db \G



use test


Now trying running this SQL statement 30 times:




DELETE FROM mysql.db WHERE db LIKE 'tes%' AND user='';

For further clarification, see my post MySQL : Why are there "test" entries in mysql.db?

Cheers !!!

share|improve this answer
Isn't there a way to use the drop user syntax instead of modifying the underlying mysql.user table directly? –  Pacerier Oct 4 '14 at 9:29
@Pacerier Please look at the original question. The real problem is that the DROP USER syntax does not work when the user field is blank (empty string). You must do it the way answer specifies. –  RolandoMySQLDBA Oct 4 '14 at 18:50
@RolandoMySQLDBA, Are there other solutions besides hacking around with the mysql.user table? –  Pacerier Oct 4 '14 at 22:58
@Pacerier If you read my last link, you will realize that MySQL (now Oracle) places two rows directly into mysql.db upon installation that will allow anonymous users to access a test database. Interestingly, I was told that Percona Server's installation deletes those rows before its installation is complete (…). Since you are using MySQL, either run mysql_secure_installation or delete those two rows yourself. –  RolandoMySQLDBA Oct 4 '14 at 23:15

Your Answer


