Trouble Deleting a User
Posted by: exits funnel
Date: November 07, 2005 05:46PM

Hello,

I'm just starting to get my feet wet with mysql and though the manual seems clear on the issue, I'm still having trouble deleting a test account I created. I'm running mysql v4.1.1.10 on RHEL4.0.

When I ussue 'select User,Host from user where User='foouser'' mysql returns:

+---------+-----------+
| User | Host |
+---------+-----------+
| foouser | % |
| foouser | efunnel2 |
| foouser | localhost |
+---------+-----------+
3 rows in set (0.00 sec)

When I issue 'show grants for 'foouser'' mysql returns:

+------------------------------------------------------+
| Grants for foouser@% |
+------------------------------------------------------+
| GRANT USAGE ON *.* TO 'foouser'@'%' |
| GRANT ALL PRIVILEGES ON `bedrock`.* TO 'foouser'@'%' |
+------------------------------------------------------+
2 rows in set (0.00 sec)

Okay, so I understand from the manual that before I can remove the user I have to revoke his privileges. So I issue 'REVOKE ALL PRIVILEGES on *.* FROM 'foouser'; to which mysql replies:

Query OK, 0 rows affected (0.00 sec)

Okay, '0' rows affected makes me nervous but I continue by issuing: 'REVOKE GRANT OPTION on *.* FROM 'foouser';' to which mysql again replies that 0 rows were affected. So then I issue 'FLUSH PRIVILEGES' and follow it with 'SHOW GRANTS for 'foouser';' I expect to see that the grants for the user have disappeared but there seems to be no change. A couple of questions at this point:

Q1: I'm confused on one basic point. Is there one foouser user or are there three? In other words, on not sure what it means to have the same username with three different values of Host. Forgetting for the moment that they didn't seem to work, should I expect to have to issue the 'REVOKE' cammands three separate times, once for each host, or should once be suffiecent?

Q2: Is there something obviously wrong with the commands I issued?

Bear with me, I'm almost done :) Though I hadn't been able to clear the GRANTS I decided to go ahead and try to drop the user anyway. So I issued: 'DROP USER 'foouser';' to which mysql complained:

ERROR 1268 (HY000): Can't drop one or more of the requested users

I also tried with various forms of 'foouser' containing the hostname but nothing worked. So,

Q3: What's wrong with my 'DROP USER' commands?

If anyone could point me in the right direction on this stuff, I'd really appreciate it as I'm pretty stuck at the moment. Thanks in advance for any replies.

-exits

Options: ReplyQuote


Subject
Written By
Posted
Trouble Deleting a User
November 07, 2005 05:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.