3383
MariaDBERRORCommonAccess ControlHIGH confidence
Cannot grant roles to anonymous user
Production Risk
Low — GRANT fails; no change occurs.
How to reproduce
trigger — this will error
trigger — this will error
GRANT my_role TO ''@'localhost';
expected output
ERROR 3383 (HY000): Cannot grant roles to an anonymous user.
Fix
Remove anonymous user accounts
Remove anonymous user accounts
DROP USER ''@'localhost';
Why this works
Removing anonymous accounts eliminates the need to manage their privileges and improves security.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 3383 ER_CANNOT_GRANT_ROLES_TO_ANONYMOUS_USER
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev