REVOKE removes previously granted privileges or roles from a MariaDB account.
REVOKE strips a user or role of specific privileges or entire roles, immediately limiting what that account can do on the server, database, table, or column level.
Revoke privileges when an employee leaves, a service account is over-provisioned, or you need to follow the principle of least privilege during audits.
Use REVOKE ALL PRIVILEGES ON *.* FROM 'user'@'host'; This removes every privilege but keeps the account intact, allowing you to grant only what is needed later.
Target the privilege and the object: REVOKE SELECT ON ecommerce.Orders FROM 'analyst'@'%'; The user loses read access to Orders but keeps other rights.
Yes. REVOKE 'reporting_role' FROM 'analyst'@'%'; The role and its bundled privileges are detached from the user.
Always test in staging, document every REVOKE, and verify with SHOW GRANTS. Combine with FLUSH PRIVILEGES only if you edited mysql.* tables directly.
No. Any user with GRANT OPTION on the targeted privilege can revoke it. Administrators typically have the SUPER or DBA role to cover all cases.
Yes, changes are instant for new connections. Existing sessions keep current rights until they reconnect.
Run SHOW GRANTS FOR 'user'@'host'; to confirm that the unwanted privileges are gone.