List:General Discussion« Previous MessageNext Message »
From:Sudhir Menon Date:July 24 2009 5:03am
Subject:RE: How do you remove a user from the grant table?!!
View as plain text  
*mysql> create user 'test'@'localhost' identified by 'pass';*
Query OK, 0 rows affected (0.00 sec)

*mysql> GRANT CREATE, DELETE ON *.* TO 'test'@'localhost';*
Query OK, 0 rows affected (0.00 sec)

*mysql> select * from information_schema.user_privileges where grantee like
"'test'@'localhost'";*
+--------------------+---------------+----------------+--------------+
| GRANTEE            | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE |
+--------------------+---------------+----------------+--------------+
| 'test'@'localhost' | NULL          | DELETE         | NO           |
| 'test'@'localhost' | NULL          | CREATE         | NO           |
+--------------------+---------------+----------------+--------------+
2 rows in set (0.00 sec)

*mysql> REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'test'@'localhost';*
Query OK, 0 rows affected (0.00 sec)

*mysql> select * from information_schema.user_privileges where grantee like
"'test'@'localhost'";*
+--------------------+---------------+----------------+--------------+
| GRANTEE            | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE |
+--------------------+---------------+----------------+--------------+
| 'test'@'localhost' | NULL          | USAGE          | NO           |
+--------------------+---------------+----------------+--------------+
*
<http://dev.mysql.com/doc/refman/5.0/en/revoke.html>REVOKE<http://dev.mysql.com/doc/refman/5.0/en/revoke.html>removes
privileges, but does not drop
mysql.user table entries. To remove a user account entirely, use DROP
USER<http://dev.mysql.com/doc/refman/5.0/en/drop-user.html>

mysql> drop user 'test'@'localhost;

mysql> select * from information_schema.user_privileges where grantee like
"'test'@'localhost'";
Empty set (0.00 sec)
*

Thread
How do you remove a user from the grant table?!!Daevid Vincent23 Jul
RE: How do you remove a user from the grant table?!!Sudhir Menon24 Jul