3390
MySQLERRORNotableAccess ControlHIGH confidence

Role cycle detected in the role hierarchy

Production Risk

Low — GRANT fails; no cycle is created.

How to reproduce
trigger — this will error
trigger — this will error
-- Detected during GRANT ROLE that would complete a cycle.

expected output

ERROR 3390 (HY000): Role cycle detected.

Fix

Revoke one grant to break the cycle

Revoke one grant to break the cycle
REVOKE role_b FROM role_a;

Why this works

Removing one edge in the role graph eliminates the cycle.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3390 ER_ROLE_CYCLES_DETECTED

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

← All MySQL errors