How to Configure Goose MariaDB Permissions
You set up goose mariadb permissions by creating a dedicated database user for migrations. Then you grant that user rights to change tables and track version history. Teams often use a root account during early setup to move fast. Broad database roles let one bad script drop production tables or leak private rows. How goose mariadb permissions work in practice Goose is a schema tool that runs SQL changes in order. It needs a database account that can log in and read a version table. If that t
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 goose mariadb permissions by creating a dedicated database user for migrations. Then you grant that user rights to change tables and track version history. Teams often use a root account during early setup to move fast. Broad database roles let one bad script drop production tables or leak private rows.
How goose mariadb permissions work in practice
Goose is a schema tool that runs SQL changes in order. It needs a database account that can log in and read a version table. If that tracking table does not exist, the tool must create it first. From there, the tool reads pending migration files from your code repo.
Each migration file holds SQL commands that alter your database structure. To run these files, the MariaDB user needs schema change rights. You grant rights to create, alter, and drop tables within one target schema. You also grant rights to insert and delete rows in the version table.
Some migrations also move data or backfill new columns with default values. For those steps, the database role needs read and write rights on app tables. Admins usually group these grants into a migration role inside MariaDB. The deployment runner then uses a static password to log in and run changes.
What native MariaDB roles solve and where they fall short
Native MariaDB roles do a good job of scoping access to specific schemas. They stop a migration runner from touching other databases on the same host. You can also limit which network addresses can log in with that user. This setup separates schema change accounts from normal app traffic.
Still, static grants only check who logs in at the start. Once the session starts, MariaDB trusts every command that matches the broad role. A role that can alter tables can also drop a key table by mistake. Native grants cannot tell a safe column addition from a destructive table drop.
AI Agent Permissions + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Shared migration keys also create blind spots in your audit logs. When five engineers share one runner account, the database log shows one generic user. You cannot see which person ran a manual migration during an outage. Also, a developer using that role for debugging can pull emails or card numbers.
Scoping schema changes for safer database updates
To lower risk, teams split daily read tasks from schema update tasks. Engineers use read roles for daily checks, while automation runs the schema updates. Even then, automated jobs fail and humans must step in to fix broken states. Giving a human raw migration credentials brings back the risk of bad commands.
Teams need a way to check individual SQL statements before the database runs them. They also need to tie every schema command back to a specific human user. Masking fields like phone numbers or national IDs in query results adds another safeguard. This keeps sensitive rows safe while engineers fix broken migration states.
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 is an open-source proxy that runs as a sidecar for your MySQL. It reads plain queries, prepared statements, and cursors on the wire.
First, hoop.dev guardrails block banned actions before MySQL runs them. An AI Analyzer you configure can score intent, and hoop.dev data masking rewrites sensitive string columns in results. Every query and verdict goes to the resource audit trail. Find the open-source binary on GitHub.
Frequently asked questions
What minimum grants does Goose need in MariaDB?
The user needs rights to create, read, and write to the version tracking table. It also needs schema rights like create and alter for the objects you change.
Should my app and Goose share the same MariaDB user?
No, you should keep those database accounts separate at all times. Your app only needs row read and write rights, not table drop rights.
Why are static migration passwords a risk for teams?
Static keys often live in build servers and local laptops for months. Anyone with the key can run destructive SQL without an individual audit trail.
Related guides
In this post