# Nexus 3 Fails to Connect to PostgreSQL with "password authentication failed for user 'nexus'" Despite Correct Credentials

**URL:** <https://community.sonatype.com/t/nexus-3-fails-to-connect-to-postgresql-with-password-authentication-failed-for-user-nexus-despite-correct-credentials/16316>\
**Category:** Sonatype Nexus Repository\
**Tags:** nexus\
**Created:** [May 6, 2026, 3:04pm UTC](https://community.sonatype.com/t/nexus-3-fails-to-connect-to-postgresql-with-password-authentication-failed-for-user-nexus-despite-correct-credentials/16316 "2026-05-06T15:04:24Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![prateek\_dodda](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@prateek\_dodda](https://community.sonatype.com/u/prateek_dodda)\
**Post date:** [May 6, 2026, 3:04pm UTC](https://community.sonatype.com/t/nexus-3-fails-to-connect-to-postgresql-with-password-authentication-failed-for-user-nexus-despite-correct-credentials/16316/1 "2026-05-06T15:04:25Z")

</div>

I am running Nexus Repository Manager 3 (version 3.77.0, previously 3.76.1) in Kubernetes, using the official Helm chart. I am attempting to migrate from the embedded H2 database to an external PostgreSQL (Cloud SQL) instance.

- The Kubernetes secret for database credentials is correct and matches what works with psql from a debug pod.
- The Nexus pod’s environment variables (`POSTGRES_USER`, `POSTGRES_PASSWORD`, etc.) are set correctly and match the new PostgreSQL user and database.
- I can connect to the database from a debug pod using the same credentials.
- However, Nexus fails to start and logs show:  
`FATAL: password authentication failed for user "nexus"`
- The logs also show Nexus is still trying to connect as user “nexus” to the old database, even after updating the environment variables and secret to use a new user/database.
- I have not removed or renamed the `nexus.mv.db` file, as per Sonatype documentation.
- I need to preserve all existing data during this migration.

**What I’ve Tried:**

- Verified all secrets, environment variables, and network connectivity.
- Created a new PostgreSQL user and database, updated the secret, and restarted the pod.
- Confirmed the pod is using the new environment variables.
- Nexus still attempts to connect with the old user/database, not the new ones.

How can I safely migrate Nexus from H2 to PostgreSQL, ensuring it uses the new user/database and preserves all existing data, without removing the H2 files?

---

_[View the full topic](https://community.sonatype.com/t/nexus-3-fails-to-connect-to-postgresql-with-password-authentication-failed-for-user-nexus-despite-correct-credentials/16316)._
