How to Configure Amazon Q MariaDB Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up amazon q mariadb read only access by creating a restricted database user. Then you give that database role only select rights on specific tables. Teams often let their AI coding agent use a shared developer login at first. That broad role lets the agent change data or drop tables by mistake. A dedicated read-only user stops the agent from running write commands. How amazon q mariadb read only access works Amazon Q Developer runs local terminal commands and external tools on a devel

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 set up amazon q mariadb read only access by creating a restricted database user. Then you give that database role only select rights on specific tables. Teams often let their AI coding agent use a shared developer login at first. That broad role lets the agent change data or drop tables by mistake. A dedicated read-only user stops the agent from running write commands.

How amazon q mariadb read only access works

Amazon Q Developer runs local terminal commands and external tools on a developer machine. When the agent needs database facts, it uses a local client or tool server. That client connects to the MariaDB server with a username and password. MariaDB checks the account privileges stored in its internal grant tables. If the user only has select rights, the database blocks any write query. The server rejects insert, update, delete, and schema change statements right away. You can scope this role to one schema or a few safe tables. You can also set up view objects to hide specific columns from the user. The agent gets the schema details and row counts it needs to write code. It cannot alter production rows or break table structures during a coding task.

What native database roles solve and what they miss

Native MariaDB roles solve the basic problem of accidental writes and table drops. They decide who can log in and which objects that account can read. Still, database grants do not inspect what individual queries do in flight. A read-only user can still run a huge join that locks up CPU. The agent can pull millions of rows into its prompt context window. Native roles also return raw table data to every allowed select query. If a table holds emails, phone numbers, card numbers, or national IDs, queries return them. You would have to build and maintain custom database views for every single table. Developers also store the database password in plain text on their laptops. Anyone or any local script on that machine can read and reuse that key. Also, shared database accounts make auditing very hard for security teams. The database log shows the shared read-only role, not which engineer ran the prompt.

Managing credentials and query safety for AI agents

Giving an AI tool direct network path and static keys creates daily work. You have to rotate passwords across every developer laptop when someone leaves the team. You also have to update database views every time a developer adds a column. Teams need a way to link each query to an individual person. They also need a way to rewrite sensitive fields like emails in query results. Controlling access at the query level stops bad reads before they hit the database. It also keeps static database passwords off local workstations and out of agent logs.

Auditor Read-Only Access + Customer Support Access to Production: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Inspect every MySQL query and response in flight

Static grants and network rules block bad logins. They cannot pause a risky query for review or mask emails in a result set. By design, hoop.dev sits inline in the MySQL protocol as a sidecar for your MySQL. For every plain query, prepared statement, or cursor an agent or human runs in production, hoop.dev decides to pass, mask, block, or hold it for review.

First, hoop.dev guardrails block banned actions before MySQL runs them, and an AI Analyzer you configure can score intent or escalate for approval. Next, hoop.dev data masking rewrites sensitive string columns in results in memory, and every verdict goes to the audit trail. Find the open-source binary on GitHub.

Frequently asked questions

Can a MariaDB read-only user still slow down the database?

Yes, a read-only user can run heavy select queries without limits or indexes. You must set MariaDB resource limits on the account to cap query time.

Does a read-only role hide sensitive customer columns from Amazon Q?

No, select rights on a table return all columns and rows by default. You must grant column-level select rights or use dynamic data masking to rewrite fields.

Where should teams store MariaDB credentials used by local AI agents?

Do not store plain-text database passwords inside shared project files or git repos. Use an OS keychain or remove local database keys by routing queries through identity checks.

The query runs. The emails stay hidden.