How do I revoke privileges

To revoke privileges in MySQL, you can use the REVOKE statement. This allows you to remove specific permissions that were previously granted to a user or a role. The syntax for revoking privileges is as follows:

REVOKE privilege_type ON object_type object_name FROM 'username'@'host';

For example, to revoke the SELECT privilege on a table named customers from a user john connecting from localhost, the command would be:

REVOKE SELECT ON customers FROM 'john'@'localhost';

Make sure to replace privilege_type, object_type, object_name, username, and host with the appropriate values as per your requirement.


mysql revoke privileges mysql user permissions mysql REVOKE statement