> ## 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.

# Connect a database

> Connect a database to Genloop: grant network access, enter credentials or an SSH tunnel, select tables, and generate memory your team can query in natural language.

Genloop connects to your database with read-only access and builds queryable memory from the tables you select. It reads from your source directly, without copying or moving your data.

Supported engines: PostgreSQL, MySQL, Snowflake, BigQuery, Redshift, Oracle, Aurora, ClickHouse, Databricks, Trino, Azure SQL, and SAP HANA.

Open the **Structured Data** tab and click **Connect database** to begin.

<Frame>
  <img src="https://mintcdn.com/genloop-20793dfe/cRpmf3-57kPIOPDf/images/Data-sources-list.png?fit=max&auto=format&n=cRpmf3-57kPIOPDf&q=85&s=770d7e4718903c08cf73475b003527d8" alt="Structured Data connections list" width="1615" height="907" data-path="images/Data-sources-list.png" />
</Frame>

## Before you begin

The **Add New Connection** screen opens with a **Before you start** panel. Both steps below are optional. Complete them only if they apply to you.

<Frame>
  <img src="https://mintcdn.com/genloop-20793dfe/cRpmf3-57kPIOPDf/images/Before-you-start.png?fit=max&auto=format&n=cRpmf3-57kPIOPDf&q=85&s=03fc6d5f712d9ae2ed06a4825e29f627" alt="Before you start panel with invite and IP allowlist" width="1076" height="296" data-path="images/Before-you-start.png" />
</Frame>

**If you do not have the credentials**, enter a colleague's email under **Get credentials** and click **Send Invite**. They can open the connection and complete the setup for you.

**If your database is behind a firewall**, click **Copy IP address**, select your region, and add the address to your database's inbound rules. Skip this step if your database already accepts connections from any IP address.

| Region       | IP address     |
| ------------ | -------------- |
| `us-east-1`  | `52.21.2.252`  |
| `ap-south-1` | `13.233.59.14` |

## Connect your database

<Steps>
  <Step title="Choose your database type">
    Select your engine from the supported list, then click **Add connection details**.

    <Frame>
      <img src="https://mintcdn.com/genloop-20793dfe/cRpmf3-57kPIOPDf/images/Database-type.png?fit=max&auto=format&n=cRpmf3-57kPIOPDf&q=85&s=fc70fb2b9c9214e6cefb11aafc27bdf9" alt="Choose a database type" width="1627" height="907" data-path="images/Database-type.png" />
    </Frame>
  </Step>

  <Step title="Enter connection details">
    Name the connection, confirm the **Data Source**, and complete the fields for your database.

    <Frame>
      <img src="https://mintcdn.com/genloop-20793dfe/cRpmf3-57kPIOPDf/images/Connection-details.png?fit=max&auto=format&n=cRpmf3-57kPIOPDf&q=85&s=d0dff41ba88971d9e8fe7825da78836c" alt="Enter host, port, database, and credentials" width="1627" height="908" data-path="images/Connection-details.png" />
    </Frame>

    | Field        | Description                                                    |
    | ------------ | -------------------------------------------------------------- |
    | **Host**     | Hostname or IP address of your database server                 |
    | **Port**     | Port your database listens on. Each engine has its own default |
    | **Database** | Name of the database to connect                                |
    | **Username** | User Genloop connects as                                       |
    | **Password** | Password for that user                                         |

    The connecting user needs read access only. Genloop never writes to your source. Field names and defaults vary by engine — see the [database guides](/using-genloop/connections/databases/mysql) for yours.
  </Step>

  <Step title="Add an SSH tunnel (optional)">
    If you reach the database through a bastion or jump host, enable **Connect via SSH tunnel** and complete the tunnel fields.

    <Frame>
      <img src="https://mintcdn.com/genloop-20793dfe/cRpmf3-57kPIOPDf/images/Ssh-tunnel.png?fit=max&auto=format&n=cRpmf3-57kPIOPDf&q=85&s=17fbdb6264634b32fb3a2a62f2c03f09" alt="SSH tunnel fields including host, username, and PEM key" width="1627" height="910" data-path="images/Ssh-tunnel.png" />
    </Frame>

    | 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** | Database host as seen from the bastion. Use `127.0.0.1` if the database runs on the bastion |
    | **Remote bind port**    | Database port as reached from the bastion                                                   |
  </Step>

  <Step title="Validate the connection">
    Click **Connect & Save**. Genloop validates the connection and opens table selection when it succeeds. A failed validation names the exact problem to fix, usually a credential, a port, or an IP address that still needs to be allowed.
  </Step>

  <Step title="Select tables and columns">
    Choose the tables and columns to build memory on. Select a table to view its columns, and use **Select all** or **Clear** to adjust. Start with the tables that answer your team's most common questions; you can add more later. The footer totals your selected **Tables**, **Columns**, and **Workspace Tables** against your plan limit.

    <Frame>
      <img src="https://mintcdn.com/genloop-20793dfe/cRpmf3-57kPIOPDf/images/Select-tables-columns.png?fit=max&auto=format&n=cRpmf3-57kPIOPDf&q=85&s=5069321ee685421954c7fcbc2ad498e9" alt="Select tables and columns to onboard" width="1622" height="906" data-path="images/Select-tables-columns.png" />
    </Frame>
  </Step>

  <Step title="Generate memory">
    Click **Generate memory**. Genloop builds the semantic context: column descriptions, table relationships, and business meaning. Progress appears as each stage completes. When it finishes, the connection is live and ready to query in Chat.
  </Step>
</Steps>

## Keep tables in sync

Schemas change as tables and columns are added or dropped. Open a connection and click **Refresh** to re-read the live schema. Genloop detects the drift and shows what changed, so your selection stays aligned with the database.

## Add more tables later

Onboard in stages. Tables that already have memory show an **In Context** badge. To add tables you skipped, reopen the connection, select the remaining tables or columns, and click **Generate memory**. Genloop processes only the new selection and leaves your existing memory unchanged.

<Frame>
  <img src="https://mintcdn.com/genloop-20793dfe/cRpmf3-57kPIOPDf/images/Delta-onboarding.png?fit=max&auto=format&n=cRpmf3-57kPIOPDf&q=85&s=8eac30c88aea1ce1c3be98a1ff793b0d" alt="Delta onboarding — already-onboarded tables marked In Context" width="1630" height="912" data-path="images/Delta-onboarding.png" />
</Frame>

## Remove a connection

Connections appear in the **Structured Data** tab with their source, last successful sync, and latest sync time. Open the **⋯** menu on a row to manage it.

<Warning>
  Removing a connection is permanent. It deletes the connection and everything derived from it, including generated semantics, stored credentials, and its registry entry. To pick up schema changes without losing memory, use **Refresh** instead.
</Warning>

<Frame>
  <img src="https://mintcdn.com/genloop-20793dfe/cRpmf3-57kPIOPDf/images/Remove-connection.png?fit=max&auto=format&n=cRpmf3-57kPIOPDf&q=85&s=36b2aff4035f0596d6a2b9cd6da0172b" alt="Remove connection confirmation" width="572" height="218" data-path="images/Remove-connection.png" />
</Frame>

## Next steps

<CardGroup cols={2}>
  <Card title="Database guides" icon="server" href="/using-genloop/connections/databases/mysql">
    Field-by-field setup for your specific database.
  </Card>

  <Card title="Upload a data file" icon="file-up" href="/using-genloop/connections/upload-a-data-file">
    Add CSV or Excel files alongside your database.
  </Card>

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

  <Card title="Unstructured Data" icon="file-text" href="/using-genloop/connections/unstructured-data">
    Add business documents that inform Genloop's answers.
  </Card>
</CardGroup>
