How to Configure MariaDB Password Policy

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a mariadb password policy by turning on native validation plugins. These plugins check new passwords against length, character, and age rules. Most teams start by setting up shared database accounts for their apps and developers. When those accounts have broad roles, one weak or stolen password puts all data at risk. How a mariadb password policy works under the hood MariaDB uses built-in plugins to check password strength when you create or change an account. The database server l

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 a mariadb password policy by turning on native validation plugins. These plugins check new passwords against length, character, and age rules. Most teams start by setting up shared database accounts for their apps and developers. When those accounts have broad roles, one weak or stolen password puts all data at risk.

How a mariadb password policy works under the hood

MariaDB uses built-in plugins to check password strength when you create or change an account. The database server loads these plugins at startup or during a live session. When a user sets a password, the server runs the string through active check plugins. If the password fails any rule, the database rejects the change right away.

Admins can set rules for minimum length and required character types. You can require numbers, mixed case letters, and special symbols in every secret. Some plugins also check passwords against a list of common words or the username itself. This stops users from picking simple secrets that attackers can guess fast.

Beyond complexity, the database tracks password age and login failures per account. Admins can force users to rotate their secrets after a set number of days. You can also lock an account after too many failed login attempts in a row. These controls live inside the database engine and apply to local user accounts.

Account lifecycle and rotation rules

Managing secret age is a big part of any database security plan. When a password expires, MariaDB blocks the user or puts the session in a sandbox mode. In that mode, the user can only run a statement to pick a new secret. This forces regular rotation for human users who log in with local credentials.

App accounts need a different plan because forced expiration can break live services. Teams often turn off expiration for service accounts and rotate those keys through deploy scripts. If two apps share one database user, rotating that secret requires updating both apps at once. Splitting accounts by service makes secret rotation much safer during routine maintenance.

You can also enforce password history rules on MariaDB accounts. History checks stop a user from reusing their old password during a forced reset. The server stores hashes of past secrets and compares them during every update. Together, age and history rules keep static secrets from staying valid forever.

Application-to-Application Password Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native password rules solve and what they miss

Native password rules stop weak secrets and slow down brute-force attacks at login time. They help teams meet basic audit rules for local database accounts. If someone tries to set a short password, the database blocks the update. If a bot guesses passwords, account locking stops the attack after a few tries.

Still, a password rule only checks who can log in to the server. Once a user logs in, the password policy does nothing more. The user still holds a raw secret on their laptop or in a config file. They can run any query that their database role allows during that session.

Shared roles make this gap much worse for engineering teams. Developers often log in with broad read or write rights to fix bugs. A strong password does not stop an approved user from reading all rows in a table by default. It cannot rewrite emails, phone numbers, card numbers, or national IDs in query results. It also cannot require a peer review before a user runs a drop or delete command.

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

Does a new password rule change existing MariaDB accounts right away?

No, validation plugins only check passwords when you create an account or change a secret. Existing users keep their current passwords until you force an expiration or manual reset.

Can I set different expiration times for specific database users?

Yes, MariaDB lets admins set a global expiration rule and override it per user. This lets you expire human accounts often while keeping service accounts stable for apps.

Do password rules protect sensitive data after a user logs in?

No, password rules only control the login step and secret strength. They do not filter queries, require approval for risky writes, or mask fields like emails and card numbers.

The query runs. The emails stay hidden.