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

# Aurora

> Connect an Amazon Aurora cluster to Genloop in MySQL or PostgreSQL mode with cluster endpoint and read-only credentials, optionally through an SSH tunnel.

Genloop connects to Amazon Aurora over a direct connection using a read-only user. Aurora runs in one of two modes, MySQL or PostgreSQL, and you tell Genloop which one your cluster uses.

## Before you connect

* An Aurora user with read access to the tables you want to query.
* Whether your cluster is **MySQL** or **PostgreSQL** compatible.
* Network access from Genloop. If your cluster is in a VPC, allow Genloop's regional IP address in its security group. See [Before you begin](/using-genloop/connections/connect-a-database#before-you-begin).

## Connection fields

| Field               | Description                                                                                   |
| ------------------- | --------------------------------------------------------------------------------------------- |
| **Connection name** | A name to identify this connection in Genloop                                                 |
| **Engine**          | The cluster's compatibility mode: `mysql` or `postgresql`                                     |
| **Host**            | Your Aurora cluster endpoint                                                                  |
| **Port**            | The port your cluster listens on. Defaults to `3306` (MySQL mode) or `5432` (PostgreSQL mode) |
| **Database**        | Name of the database to connect                                                               |
| **Username**        | Aurora user Genloop connects as                                                               |
| **Password**        | Password for that user                                                                        |

## Connect through an SSH tunnel

If the cluster is not reachable directly, reach it through a bastion or jump host. Turn on **Connect via SSH tunnel** in the connection form and complete these fields.

| Field                   | Description                                                                               |
| ----------------------- | ----------------------------------------------------------------------------------------- |
| **SSH host**            | Public IP or DNS of the bastion. Cannot be `localhost`                                    |
| **SSH port**            | SSH port on the bastion. Default is `22`                                                  |
| **SSH username**        | User Genloop signs in to the bastion as                                                   |
| **PEM key**             | Your private key file. Sent encrypted with the rest of the credentials                    |
| **Remote bind address** | Cluster host as seen from the bastion. Use `127.0.0.1` if the cluster runs on the bastion |
| **Remote bind port**    | Cluster port as reached from the bastion                                                  |

## Permissions

Genloop only reads your data and never writes to your cluster. You can connect with any user that already has read access to the tables you select.

If you want a dedicated read-only user for Genloop, ask your database administrator to set one up.

<Accordion title="Minimal read-only grant (for your database administrator)">
  Run the commands for your cluster's engine:

  ```sql theme={null}
  -- MySQL-compatible
  GRANT SELECT ON your_database.* TO 'genloop_user'@'%';

  -- PostgreSQL-compatible
  GRANT USAGE ON SCHEMA public TO genloop_user;
  GRANT SELECT ON ALL TABLES IN SCHEMA public TO genloop_user;
  ```
</Accordion>

## Next steps

<CardGroup cols={2}>
  <Card title="Connect a database" icon="database" href="/using-genloop/connections/connect-a-database">
    Back to the full connection flow.
  </Card>

  <Card title="Context Hub" icon="brain" href="/using-genloop/context-hub">
    View and edit the memory built from your connection.
  </Card>
</CardGroup>
