> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

# How do I reset or change my database password in Neon?

Reset a role password from the Console, the Neon CLI, the Neon API, or with ALTER ROLE in SQL.

Last updated: 2026-11-05

Postgres roles on Neon are branch-scoped, so each branch keeps its own password for a role. You can reset a password from the **Roles** page in the Console, with the Neon CLI or API, or by running `ALTER ROLE ... WITH PASSWORD '...'` from any SQL client. The reset takes effect immediately. The old password stops working on the next connection, so copy the updated connection string from the **Connect** modal. See [Reset a password](https://neon.com/docs/manage/roles#reset-a-password).

## Reset the password

**Console**

1. Open your project in the [Neon Console](https://console.neon.tech).
2. In the sidebar, select your branch from the **BRANCH** selector.
3. Under **Postgres database**, select **Roles**.
4. From the role's menu, choose **Reset password**.
5. Click **Reset**. A modal shows the new generated password. Copy it into your secret manager.

See [Reset a password](https://neon.com/docs/manage/roles#reset-a-password).

**CLI**

Reset the password with [`neon roles reset-password`](https://neon.com/docs/cli/roles#reset-password). It prints the new password and waits until the compute applies it:

```bash
neon roles reset-password alex --branch main
```

**API**

```bash
curl -X POST \
  "https://console.neon.tech/api/v2/projects/$PROJECT_ID/branches/$BRANCH_ID/roles/$ROLE_NAME/reset_password" \
  -H "Authorization: Bearer $NEON_API_KEY" \
  -H "Accept: application/json"
```

The response body contains the new password under `role.password`. See the [Reset role password](https://neon.com/docs/reference/api/branches/reset-project-branch-role-password) API reference.

**SQL**

The Console, CLI, and API always generate a random password. To set a value you choose (for example, one already stored in your secret manager), connect with the [SQL Editor](https://neon.com/docs/get-started/query-with-neon-sql-editor), [psql](https://neon.com/docs/connect/query-with-psql-editor), or any SQL client, and run `ALTER ROLE`.

```sql
ALTER ROLE alex WITH PASSWORD 'new_password';
```

Passwords need at least 60 bits of entropy. In practice, that means 12 or more characters that mix lowercase, uppercase, digits, and symbols, with no dictionary words or sequences. See the [password guidelines](https://neon.com/docs/manage/roles#manage-roles-with-sql).

## After the reset

- Any application still using the old password gets an authentication error on its next connection attempt. Update your environment variables, `.env` files, and secret stores right away.
- The hostname and database name in the connection string don't change. Only the password segment is new.
- The reset applies only to the branch you ran it on. Child branches keep the old password until you reset the role on each of them.

> **Manage roles end to end**
>
> See the full role management guide, including the API reference and the neon_superuser role.
>
> [Read the docs](https://neon.com/docs/manage/roles)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/faqs/reset-database-password"}` to https://feedback.neon.tech/ (no auth required).
