Cannot drop anonymous user from mysql.user
Asked 11 years, 5 months ago
Modified 8 years, 4 months ago
Viewed 18k times
18
I am trying to DROP the anonymous users from my mysql.users database. However, I have been getting odd behavior. When I enter the command:
DROP User ''@'WOPR';
I was getting a generic error message. So, I rebooted my machine, and tried it again. This time I got the response
Query OK, 0 rows affected.
But when I put in
SELECT User, Host, Password FROM mysql.user WHERE User='';
The return is:
I am trying to DROP the anonymous users from my mysql.users database. However, I have been getting odd behavior. When I enter the command:
DROP User ''@'WOPR';
I was getting a generic error message. So, I rebooted my machine, and tried it again. This time I got the response
Query OK, 0 rows affected.
But when I put in
SELECT User, Host, Password FROM mysql.user WHERE User='';
The return is:
+------+------+----------+
| User | Host | Password |
+------+------+----------+
| | WOPR | |
+------+------+----------+
(WOPR is my hostname)
I run the command
DROP User ''@'WOPR';
and get the same result.
Solution:
DELETE FROM mysql.user WHERE user='' AND host='WOPR';
FLUSH PRIVILEGES;
This should do it for you.
Give it a Try !!!
======================OR=============
DELETE FROM mysql.user WHERE user='' AND host='localhost';
FLUSH PRIVILEGES;
Top comments (0)