*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)
*

Reply via email to