# FATAL: Password authentication failed

A `FATAL: Password authentication failed` error means Postgres rejected your credentials. Check the username before the password, because the username is the more common mistake.

## Check the username first

The username depends on how you connect:

- Direct connections and the dedicated pooler use `postgres`.
- Shared pooler connections use `postgres.[PROJECT-REF]`.

Supplying the wrong one usually produces [Tenant or user not found](https://supabase.com/docs/guides/troubleshooting/tenant-or-user-not-found) rather than this error, but a valid username with the wrong password lands here.

## Check the password

Reserved characters in a password have to be [percent-encoded](https://en.wikipedia.org/wiki/Percent-encoding) when they appear in a connection string. This covers `&`, `#`, `?`, and spaces, among others. A password that works in a GUI field can fail in a URI for this reason alone.

If you don't have the password, [reset it](https://supabase.com/docs/guides/troubleshooting/how-do-i-reset-my-supabase-database-password-oTs5sB) in [Database settings](https://supabase.com/dashboard/project/_/database/settings).

## Repeated failures cause a different error

Repeated authentication failures from the same address get that address banned. Once banned, connections stop failing with this error and start failing with [connection refused](https://supabase.com/docs/guides/troubleshooting/error-connection-refused-when-trying-to-connect-to-supabase-database-hwG0Dr) instead.

If your error changes from authentication failed to connection refused while you're testing credentials, you're banned rather than locked out. That page has the unban procedure.
