# Database
URL: /reference/integrations/database
Type: reference
Description: Connect to a PostgreSQL or MySQL database for workflow queries.
Keywords: database, integration, api key, connect
Connect to a PostgreSQL or MySQL database for workflow queries.

Connect [#connect]

Connect Database with an API key in **Settings → Integrations**. Open the Database card, click **Connect**, and provide:

| Field         | Required | Notes                 |
| ------------- | -------- | --------------------- |
| Host          | Yes      | e.g. `db.example.com` |
| Port          | No       | e.g. `5432`           |
| Database Name | Yes      | e.g. `my_database`    |
| Username      | Yes      | e.g. `readonly_user`  |
| Password      | Yes      | —                     |

Supported actions and triggers [#supported-actions-and-triggers]

Actions [#actions]

| Block                                                     | What it does                              |
| --------------------------------------------------------- | ----------------------------------------- |
| [Database Query](/reference/blocks/system-database-query) | Execute SQL queries against your database |

Limits and failure modes [#limits-and-failure-modes]

* The connection can expire or be revoked. When it does, Database blocks fail with an authorization error until you reconnect in **Settings → Integrations**.
* A disconnected or unconfigured integration makes its blocks unavailable in the Workflow Builder.

{/* TODO(docs): document Database-specific rate limits and permission errors — not encoded in @stylo/core. */}

Related [#related]

* [Integrations overview](/integrations)
* [All workflow blocks](/reference/blocks)
* [Troubleshooting](/troubleshooting)