# The app can't connect to the database

**What you see:** Errors mention the database, `DATABASE_URL` or a connection timeout.

**Why it happens:** The connection setting is missing, wrong for this environment, or the database branch doesn't exist.

## How to fix it

1. Ask your agent to check `DATABASE_URL` is set (names only) in this environment.
2. For your computer, it pulls a development branch's settings with `vercel env pull`, never production's.

## Message for your agent

```text
My app can't connect to the database. Check DATABASE_URL is set for this environment (don't show it), confirm we use a development branch locally, and read the error to find the cause.
```

**How to prevent it:** Never point your computer at the production database.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/cant-connect-to-the-database) · License: CC BY 4.0
