Debug School

rakesh kumar
rakesh kumar

Posted on

LINUX:How to drop anonymous user from phpmyadmin

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';
Enter fullscreen mode Exit fullscreen mode

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='';
Enter fullscreen mode Exit fullscreen mode

The return is:

+------+------+----------+
| User | Host | Password |
+------+------+----------+
|      | WOPR |          |
+------+------+----------+
Enter fullscreen mode Exit fullscreen mode

(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;
Enter fullscreen mode Exit fullscreen mode

This should do it for you.

Give it a Try !!!

======================OR=============

DELETE FROM mysql.user WHERE user='' AND host='localhost';
FLUSH PRIVILEGES;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)