2

We're clearing out some old MySQL users that connected from remote hosts during a database transfer.

Why is this DROP USER query failing for the user asdfasdf_imac4? I'm logged in as root.

mysql> select user,host from mysql.user;
+------------------+----------------------+
| user             | host                 |
+------------------+----------------------+
| root             | 127.0.0.1            |
| root             | ::1                  |
| debian-sys-maint | localhost            |
| forum            | localhost            |
| root             | localhost            |
| asdfasdf_imac4   | ‘303.303.303.90’     |
| asdfasdf_imac4   | ‘303.303.303.92’     |
+------------------+----------------------+
7 rows in set (0.00 sec)

mysql> drop user 'asdfasdf_imac4'@'303.303.303.90';
ERROR 1396 (HY000): Operation DROP USER failed for 'asdfasdf_imac4'@'303.303.303.90'
1

I have never seen an IP address like that before. Since 303 is an impossible number for an IP address, you should just save yourself the headache and delete both from mysql.user

DELETE FROM mysql.user WHERE user='asdfasdf_imac4';
FLUSH PRIVILEGES;

Give it a Try !!!

1

I think that might because ‘303.303.303.90’ is a string with single quote, you'd better delete it like this: drop user "asdfasdf_imac4"@"'303.303.303.90'";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy