2025
MySQLERRORNotableAccess ControlHIGH confidence

There is no such grant defined for user on host

Production Risk

Low — REVOKE is rejected; no privileges are changed.

What this means

A REVOKE statement attempted to revoke a privilege that was never granted to the specified user@host combination. MySQL requires the privilege to exist before it can be revoked.

Why it happens
  1. 1Revoking a privilege that was never granted.
  2. 2Wrong user name, host, or database/table in the REVOKE statement.
  3. 3Privilege was already revoked or expired.
How to reproduce
trigger — this will error
trigger — this will error
REVOKE SELECT ON mydb.* FROM 'user'@'%'; -- if the grant does not exist

expected output

ERROR 2025 (42000): There is no such grant defined for user 'user' on host '%'.

Fix 1

Verify existing grants before revoking

Verify existing grants before revoking
SHOW GRANTS FOR 'user'@'%';

Why this works

Confirms which privileges actually exist for the user.

Fix 2

Correct the REVOKE statement to match an existing grant

Correct the REVOKE statement to match an existing grant
-- Adjust user, host, database, or privilege to match SHOW GRANTS output

Why this works

The REVOKE must exactly match a granted privilege.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 2025 ER_NONEXISTING_GRANT

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors