MySQL – Does Dropping a User Revoke Privileges?

MySQLpermissions

In MySQL, I created a user and granted all privileges to the user. I even granted proxy to user.

CREATE USER IF NOT EXISTS 'testuser'@'localhost' IDENTIFIED BY 'testpass';
GRANT ALL PRIVILEGES ON *.* TO 'testuser'@'localhost' WITH GRANT OPTION;
GRANT PROXY ON ''@'' TO 'testuser'@'localhost' WITH GRANT OPTION;

Now if I drop the user, will the user's privileges and proxy be revoked? Or do I need to manually revoke the user's privileges and proxy before I drop the user?

DROP USER IF EXISTS 'testuser'@'localhost';

Best Answer

The DROP USER statement removes one or more MySQL accounts and their privileges. It removes privilege rows for the account from all grant tables.

see http://dev.mysql.com/doc/refman/5.7/en/drop-user.html

PROXY is a GRANT privilege so the proxy privilege should be deleted also.