How to Fix MySQL Error 4009 (WARN_UNSUPPORTED_ACL_TABLES_READ)
You get mysql error 4009 when a query reads access control list tables using serializable isolation or shared locks. To fix this warning, lower the session isolation level or remove shared lock hints from queries on grant tables. MySQL logs this issue under the symbol WARN_UNSUPPORTED_ACL_TABLES_READ and SQLSTATE HY000. The official message states that reads with serializable isolation or SELECT FOR SHARE are not supported for ACL tables. Your database runs into this rule when apps or scripts i
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get mysql error 4009 when a query reads access control list tables using serializable isolation or shared locks. To fix this warning, lower the session isolation level or remove shared lock hints from queries on grant tables.
MySQL logs this issue under the symbol WARN_UNSUPPORTED_ACL_TABLES_READ and SQLSTATE HY000. The official message states that reads with serializable isolation or SELECT FOR SHARE are not supported for ACL tables. Your database runs into this rule when apps or scripts inspect internal user permission tables inside strict transactions.
What causes mysql error 4009 in the database engine
MySQL stores user accounts, roles, and privilege rules inside internal access control list tables. These system tables live in the core system schema and handle every login check. The database engine treats these permission tables differently from standard user data tables.
When a session uses the serializable isolation level, MySQL converts plain read queries into locking reads. The engine places shared locks on every row the query touches to block concurrent changes. The same lock behavior happens when a client runs a read query with an explicit shared lock clause.
Locking internal grant tables creates a high risk for the whole database server. If one transaction holds shared locks on permission rows, other users cannot log in or change passwords. Admin tasks that grant or revoke roles would also stall and wait for the lock to clear. To stop server-wide stalls, MySQL blocks shared read locks on these access control tables and raises code 4009.
How to diagnose and fix the failure in production
Start your check by looking at your query logs and database monitoring tools. Find the exact session or app user that reads from the system permission schema. In many cases, an external audit tool, backup script, or ORM framework sets strict isolation rules by mistake.
Some apps set the global or session transaction level to serializable for high data safety. When the same app checks database user roles, it triggers the unsupported read warning on the grant tables. You can fix this without giving out extra privileges or turning off safety checks for business data.
Customer Support Access to Production + MySQL Access Governance: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
First, separate your permission audit queries from your core business transactions. Set the session isolation level to repeatable read or read committed right before checking user tables. Once the audit check finishes, you can switch the session back to the stricter level for normal app tables.
Second, review any custom scripts that inspect user permissions and remove explicit shared lock clauses. Plain read queries on system views give you the exact same account data without trying to lock internal rows. Third, use built-in MySQL metadata commands to inspect grants instead of reading raw system tables directly.
How to prevent ACL table lock issues across teams
Database teams should limit who can query raw system tables in production. App accounts only need rights to read and write their own business schemas. They rarely need direct read permissions on internal account tables.
When compliance or security scripts need to check user roles, give them a dedicated read-only service account. Set up that account to use standard isolation levels by default. This simple rule keeps audit jobs from clashing with the engine lock rules and keeps logs clean.
Add wire guardrails and masking beside MySQL
Database grants and TLS setup decide who can reach MySQL. Even so, an open session can run broad updates or read raw personal data from allowed tables. In practice, hoop.dev sits inline in the wire protocol beside the database as a sidecar for your MySQL. On every production query an agent or engineer sends, hoop.dev decides to pass, mask, block, or escalate it for human review.
With hoop.dev MySQL support, guardrails refuse bad queries before they run or hold risky calls for approval, while data masking rewrites matched sensitive values in result rows in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for GDPR, HIPAA, and PCI DSS programs. Read the docs and source on GitHub.
Frequently asked questions
What is the exact message for mysql error 4009?
The server returns SQLSTATE HY000 and symbol WARN_UNSUPPORTED_ACL_TABLES_READ. The message says reads with serializable isolation or SELECT FOR SHARE are not supported for ACL tables.
Does error 4009 mean my user permissions are broken?
No, your user accounts and role grants are still safe and intact. The warning only means a client tried to put shared read locks on internal system tables.
How do I read user grants without hitting code 4009?
Switch your session to repeatable read or read committed isolation before you query system tables. You should also remove any shared lock hints and use standard grant inspection commands instead.
Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.
Related guides
In this post