1697
MySQLERRORNotableAccess ControlHIGH confidence
Illegal REVOKE of a grant not held by user
Production Risk
Low — operation fails; no privilege changes occur.
What this means
A REVOKE statement attempted to remove a privilege that the target user does not currently hold.
Why it happens
- 1Typo in the privilege name or the REVOKE target.
- 2The privilege was already revoked or was never granted.
How to reproduce
trigger — this will error
trigger — this will error
REVOKE DELETE ON mydb.* FROM 'appuser'@'localhost';
expected output
ERROR 1697 (HY000): There is no such grant defined for user 'appuser' on host 'localhost'.
Fix
Verify current grants before revoking
Verify current grants before revoking
SHOW GRANTS FOR 'appuser'@'localhost'; -- Then issue only REVOKE for privileges that are listed.
Why this works
SHOW GRANTS confirms exactly what privileges the user holds before attempting removal.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 1697 ER_REVOKE_GRANTS
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev