> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arya.so/llms.txt
> Use this file to discover all available pages before exploring further.

# MySQL / PostgreSQL

> Connect external databases for bidirectional sync with Arya.

<Frame>
  <img src="https://mintcdn.com/agevole/cM9eEPJE8FVhTNOb/images/integrazioni/mysql-postgres/shared/tile.svg?fit=max&auto=format&n=cM9eEPJE8FVhTNOb&q=85&s=d02b0ca4aa871db8ce23ba4788b7345b" alt="MySQL / PostgreSQL integration tile in Arya settings" width="1200" height="720" data-path="images/integrazioni/mysql-postgres/shared/tile.svg" />
</Frame>

## What it does

If you have an external database (MySQL, PostgreSQL) with legacy operational data, Arya can sync specific tables as objects. Configurable sync per field, frequency, direction.

## Prerequisites

<Note>
  * Active account with MySQL / PostgreSQL
  * **Admin** or **Manager** role on Arya to connect
  * OAuth authorisation (or API key, where applicable)
</Note>

## Connect MySQL / PostgreSQL

<Steps>
  <Step title="Go to Settings → Integrations">Find **MySQL / PostgreSQL** in the gallery and click **Connect**.</Step>
  <Step title="Authorise via OAuth">Opens MySQL / PostgreSQL login page. Grant requested permissions.</Step>
  <Step title="Confirm in Arya">Arya tests the connection. If OK, you see "Connected" in green.</Step>
  <Step title="Configure preferences (optional)">Sync frequency, filters, field mapping. From **Settings → Integrations → \[MySQL / PostgreSQL] → Configure**.</Step>
</Steps>

## What syncs

| Direction    | Entity                                    |
| ------------ | ----------------------------------------- |
| Configurable | DB tables ↔ Arya objects                  |
| Configurable | Explicitly mapped fields                  |
| Configurable | Frequency (real-time, every N min, daily) |

## Use in workflows

Once connected, MySQL / PostgreSQL appears as an action in the [workflow builder](/en/automations/workflow-builder). You can:

* Trigger workflows from MySQL / PostgreSQL events
* Use MySQL / PostgreSQL as an action (e.g. create record, send message)

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authorisation error">
    Expired or revoked token. Disconnect and reconnect.
  </Accordion>

  <Accordion title="Slow or failed sync">
    Check service API quota (rate limit). Reduce frequency if exceeding quota.
  </Accordion>

  <Accordion title="Data not synced">
    Verify field mapping and filters. Try manual sync from **⋯ → Sync now**.
  </Accordion>

  <Accordion title="Duplicate errors">
    Arya uses unique keys for matching. Configure key (email, external ID) in **Settings → Sync**.
  </Accordion>
</AccordionGroup>

## Disconnect

<Warning>
  Disconnection immediately stops synchronisation. Already-imported data stays in the workspace.
</Warning>

<Steps>
  <Step title="Go to Settings → Integrations">Find the MySQL / PostgreSQL card.</Step>
  <Step title="Click Disconnect">Confirm. Access token is revoked.</Step>
</Steps>
