Open your project in the Neon Console, then click Connect on the Project Dashboard. The Connect to your database widget opens with a ready-made connection string for the branch, compute, database, and role you select. Toggle Connection pooling to switch between a pooled and a direct connection string. See Connect from any app for the full reference.

Get the connection string from the Console

  1. Sign in to the Neon Console and select your project.
  2. On the Project Dashboard, click Connect.
  3. In the Connect to your database modal, choose a Branch, Compute, Database, and Role.
  4. Copy the constructed connection string. Neon shows the pooled connection string by default. Turn Connection pooling off to get the direct connection string instead.

A Neon connection string includes the role, password, hostname, and database name:

postgresql://alex:AbC123dEf@ep-cool-darkness-a1b2c3d4-pooler.us-east-2.aws.neon.tech/dbname?sslmode=require&channel_binding=require

The pooled hostname has a -pooler suffix. Use pooled for serverless and high-concurrency clients (Neon's pooler supports up to 10,000 concurrent connections per compute). Use direct for migrations, pg_dump, and LISTEN/NOTIFY. See Connection pooling for the full breakdown.

Reset or regenerate the credentials in the string

The connection string itself is fixed for a given branch, role, and database. The part you can rotate is the role's password. Resetting the password invalidates the old password immediately and produces a new connection string.

  1. In the Connect to your database modal, click the role selector and choose Reset password, or go to Branches > your branch > Roles & Databases > role menu > Reset password.
  2. Confirm. Neon generates a new password and shows it once. Update any stored connection strings or secrets right away.

Rotate the password if it leaked

If a connection string was committed to source control or shared in a chat, reset the role's password right away. The previous password stops working as soon as the reset completes, and any application still using the old string will fail to connect until it picks up the new password.

See all the connect options

Walk through the full Connect modal, language examples, and pooled vs direct guidance.