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

# AWS RDS

> Connect your Amazon RDS PostgreSQL, MySQL, MariaDB, or SQL Server database to VexiData.

## Prerequisites

* An [AWS](https://aws.amazon.com) account with an RDS database instance
* A [VexiData](https://vexidata.com) account

## Connect AWS RDS to VexiData

<Steps>
  <Step title="Get your RDS connection details">
    1. Log in to the [AWS Management Console](https://console.aws.amazon.com)
    2. Navigate to **RDS** > **Databases**
    3. Select your database instance
    4. In the **Connectivity & security** tab, find the **Endpoint** and **Port**

    | Parameter           | PostgreSQL Example                           | MySQL / MariaDB Example | SQL Server Example   |
    | ------------------- | -------------------------------------------- | ----------------------- | -------------------- |
    | **Host (Endpoint)** | `mydb.abc123xyz.us-east-1.rds.amazonaws.com` | Same format             | Same format          |
    | **Port**            | `5432`                                       | `3306`                  | `1433`               |
    | **Database**        | `postgres` (default)                         | Your database name      | Your database name   |
    | **Username**        | Your master username                         | Your master username    | Your master username |
    | **Password**        | Your master password                         | Your master password    | Your master password |

    <Info>
      The master username is set during database creation. If you've forgotten your password, you can reset it from the RDS console by selecting your instance and choosing **Modify** > **Master password**.
    </Info>
  </Step>

  <Step title="Configure Security Group for VexiData access">
    AWS RDS uses **Security Groups** as firewalls that control which IP addresses can connect. By default, your database is not accessible from the internet. You must add VexiData's IP addresses.

    1. In your RDS instance's **Connectivity & security** tab, click the active **VPC security group** link
    2. Select the security group, then click **Inbound rules** > **Edit inbound rules**
    3. Click **Add rule** and configure:

    | Field      | Value                                |
    | ---------- | ------------------------------------ |
    | **Type**   | PostgreSQL, MySQL, MariaDB, or MSSQL |
    | **Source** | Custom                               |
    | **IP**     | `46.101.71.122/32`                   |

    4. Click **Save rules**

    <Note>
      Security Group configuration is **mandatory**. Your connection will fail without this step. The `/32` suffix means a single IP address.
    </Note>
  </Step>

  <Step title="Ensure public accessibility is enabled">
    Your RDS instance must be publicly accessible for VexiData to connect:

    1. Select your database instance in the RDS console
    2. Click **Modify**
    3. Under **Connectivity**, expand **Additional configuration**
    4. Set **Publicly accessible** to **Yes**
    5. Click **Continue** > **Apply immediately**

    <Info>
      If your database was created in a private subnet, you may need to update the subnet group to include public subnets. Consult the [AWS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html) for details.
    </Info>
  </Step>

  <Step title="Add the connection in VexiData">
    1. Go to [Data Sources](https://vexidata.com/data-sources) in VexiData
    2. Click **PostgreSQL**, **MySQL**, **MariaDB**, or **SQL Server** depending on your RDS engine
    3. Fill in the details:

    | Field            | Value                                                                                         |
    | ---------------- | --------------------------------------------------------------------------------------------- |
    | **Display Name** | A name to identify this connection (e.g., "AWS RDS Production")                               |
    | **Host**         | Your RDS endpoint (e.g., `mydb.abc123xyz.us-east-1.rds.amazonaws.com`)                        |
    | **Port**         | `5432` (PostgreSQL), `3306` (MySQL / MariaDB), or `1433` (SQL Server)                         |
    | **Database**     | Your database name                                                                            |
    | **Schema**       | `public` (PostgreSQL) or `dbo` (SQL Server) — change if your tables are in a different schema |
    | **Username**     | Your master username                                                                          |
    | **Password**     | Your master password                                                                          |
  </Step>

  <Step title="Test and save">
    Click **Test & Save Connection**. VexiData will verify it can reach your database. Once connected, your schema will be analyzed automatically.
  </Step>
</Steps>

## Using a dedicated database user

The RDS master user has full admin privileges. For better security, consider creating a read-only user for VexiData:

**PostgreSQL:**

```sql theme={null}
CREATE USER vexidata WITH PASSWORD 'your-secure-password';
GRANT CONNECT ON DATABASE your_database TO vexidata;
GRANT USAGE ON SCHEMA public TO vexidata;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO vexidata;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO vexidata;
```

**MySQL / MariaDB:**

```sql theme={null}
CREATE USER 'vexidata'@'%' IDENTIFIED BY 'your-secure-password';
GRANT SELECT ON your_database.* TO 'vexidata'@'%';
FLUSH PRIVILEGES;
```

**SQL Server:**

```sql theme={null}
CREATE LOGIN vexidata WITH PASSWORD = 'your-secure-password';
USE your_database;
CREATE USER vexidata FOR LOGIN vexidata;
GRANT SELECT ON SCHEMA::dbo TO vexidata;
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection timed out">
    This is almost always a networking issue. Check all three conditions:

    1. **Security Group** — VexiData's IP (`46.101.71.122/32`) must be in the inbound rules
    2. **Public accessibility** — Must be set to **Yes** on the RDS instance
    3. **Subnet** — The instance must be in a public subnet with an internet gateway
  </Accordion>

  <Accordion title="Authentication failed">
    * Verify your master username and password. You can reset the password from the RDS console under **Modify**
    * If using a dedicated user, confirm it was created with the correct permissions
    * Check that you're connecting to the correct database name
  </Accordion>

  <Accordion title="No tables visible after connecting">
    * For PostgreSQL, confirm your tables are in the `public` schema. For SQL Server, confirm they're in the `dbo` schema. If they're in a custom schema, update the **Schema** field in VexiData
    * Check that your database user has `SELECT` permissions on the tables
  </Accordion>

  <Accordion title="SSL connection errors">
    * RDS PostgreSQL 15+ enforces SSL by default. VexiData handles this automatically
    * If you see SSL-related errors, verify your RDS instance is running and the endpoint is correct
  </Accordion>
</AccordionGroup>
