How to Fix MySQL Error 3955 (ER_USER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK)

Published
Length
3 min read

Luis Felipe Dias

All posts

The database throws mysql error 3955 when a temporary password lock blocks a user account. You fix it by having an admin clear the failed login counter for that user. This failure occurs after too many wrong passwords hit the database in a row. The server enforces a waiting period measured in days before allowing new login attempts. Understanding why the counter tripped helps your team restore service without weakening database safety rules. What causes mysql error 3955 in production In the

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.

The database throws mysql error 3955 when a temporary password lock blocks a user account. You fix it by having an admin clear the failed login counter for that user.

This failure occurs after too many wrong passwords hit the database in a row. The server enforces a waiting period measured in days before allowing new login attempts. Understanding why the counter tripped helps your team restore service without weakening database safety rules.

What causes mysql error 3955 in production

In the database engine, this failure maps to sqlstate HY000 and stops new logins. The official symbol for this block is ER_USER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK. The error message states that the account is blocked for a set number of days. It also reports how many days remain and how many consecutive failed logins occurred.

Database admins set up failed login tracking to stop brute force password attacks. Each user profile can hold a limit on bad login tries and a lock time. When a client sends a bad password, the server adds one to that counter. Once the count reaches the limit, the engine locks the account right away.

In production, automated scripts and background jobs trigger this lock most often. If a team rotates a secret but misses one app node, that node keeps retrying. The stale node hits the database with the old password until the lock engages. Shared database accounts make this problem much worse across large clusters.

If five apps share one user name, one bad deploy locks out all five apps. A developer typing the wrong password in a local database client can also trip it. Network load balancers that run bad health checks can cause the same login failure.

How to diagnose and fix the account lock

Start by reading the full error message in your app logs or client screen. Note the exact user name and client host address shown in the error text. Check the server logs to find which source IP address sent the bad passwords. You must stop the noisy service before you clear the lock on the database.

Application-to-Application Password Management + Cross-Account Access Delegation: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

If you clear the lock while a broken app still runs, it will lock again. Find the container, server, or cron job that holds the old password. Update its secret store or stop the process so the bad retries stop right away.

Next, log in to the database using an admin account with user management rights. Run an account alteration statement to release the temporary password lock on the affected user. You can also flush privileges if your server setup requires a manual grant table reload. This action resets the failed login counter back to zero and opens the account.

Do not fix this issue by removing failed login limits from your database users. Removing password lock rules leaves your database open to automated credential stuffing attacks. Do not grant superuser roles to standard app accounts to bypass security checks.

How to prevent future password lockouts

Give every app and microservice its own dedicated database user account and password. This setup isolates failures so one broken service never blocks your whole platform. Keep human engineers off shared service accounts at all times.

When engineers need to read data, give them separate roles with strict permissions. You can also add data masking to rewrite sensitive fields like emails or phone numbers. Masking also rewrites card numbers and national IDs in query results to protect privacy. Good credential hygiene and separated accounts stop lockouts before they start.

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

Does mysql error 3955 clear on its own?

Yes, the lock clears after the remaining days shown in the error message pass. Still, production teams rarely wait days and use an admin account to clear it sooner.

Tell the difference between a standard lock and a password lock?

An admin sets a standard account lock manually, and it lasts until an admin removes it. A password lock triggers by default after failed logins and expires after a set day count.

Can a correct password log in while the account is blocked?

No, the database rejects all login attempts while the temporary password lock is active. Even if you send the right password, the server returns error 3955 until unlocked.

The query runs. The emails stay hidden.