ealfonso
ealfonso

Reputation: 7302

revoke all privileges, grant option not working?

I'm trying to revoke privileges from a given user, say mysqluser1. I try, as root, revoke all privileges, grant option for mysqluser1@localhost;, then I flush privileges. When I check grants, I see that mysquser1 still has privileges. What am I doing wrong?

Below is the excerpt in question:

mysql> show grants for mysqluser1@localhost;
+---------------------------------------------------------------------------------------------------------------------+
| Grants for mysqluser1@localhost                                                                                   |
+---------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' IDENTIFIED BY PASSWORD '*ALPHANUMSTRINGHERE' |
+---------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> revoke all privileges, grant option from mysqluser1@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> show grants for mysqluser1@localhost;
+---------------------------------------------------------------------------------------------------------------------+
| Grants for mysqluser1@localhost                                                                                   |
+---------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' IDENTIFIED BY PASSWORD '*ALPHANUMSTRINGHERE' |
+---------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> 

Upvotes: 1

Views: 2617

Answers (2)

Alexandre Santos
Alexandre Santos

Reputation: 8338

@spencer was faster, but I was also going to ask, if you are trying to get rid of all privileges, then why do you need the user?

To remove a user account entirely, use DELETE. As of MySQL 4.1.1, you can also use DROP USER to remove users

Upvotes: 3

spencer7593
spencer7593

Reputation: 108400

The USAGE privilege specifier stands for "no privileges." It is used at the global level with GRANT to modify account attributes such as resource limits or SSL characteristics without affecting existing account privileges.

http://dev.mysql.com/doc/refman/5.5/en/privileges-provided.html

Upvotes: 1

Related Questions