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

# Railway

> Connect your Railway PostgreSQL or MySQL database to VexiData.

## Prerequisites

* A [Railway](https://railway.com) account with a database service
* A [VexiData](https://vexidata.com) account

## Enable external access

By default, Railway databases are only accessible from within your Railway project's private network. To connect from VexiData, you must enable public networking.

<Steps>
  <Step title="Enable TCP Proxy">
    1. Log in to your [Railway Dashboard](https://railway.com/dashboard)
    2. Select your project
    3. Click on your database service (PostgreSQL or MySQL)
    4. Go to the **Settings** tab
    5. Under **Networking**, click **Enable TCP Proxy**
    6. Railway will assign a public **domain** and **port**
  </Step>

  <Step title="Get your connection details">
    After enabling the TCP Proxy:

    1. Go to the **Connect** tab on your database service
    2. Copy the **public** connection parameters (not the private/internal ones):

    | Parameter    | Example                                   |
    | ------------ | ----------------------------------------- |
    | **Host**     | `roundhouse.proxy.rlwy.net`               |
    | **Port**     | `43721` (randomly assigned)               |
    | **Database** | `railway`                                 |
    | **Username** | `postgres` (PostgreSQL) or `root` (MySQL) |
    | **Password** | Your database password                    |

    <Note>
      Railway assigns a **random port** for the TCP proxy — it won't be the standard `5432` or `3306`. Make sure you copy the public port, not the internal one.
    </Note>
  </Step>

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

    **For PostgreSQL:**

    | Field            | Value                                                                |
    | ---------------- | -------------------------------------------------------------------- |
    | **Display Name** | A name to identify this connection (e.g., "Railway Production")      |
    | **Host**         | Your public proxy host (e.g., `roundhouse.proxy.rlwy.net`)           |
    | **Port**         | Your assigned proxy port (e.g., `43721`)                             |
    | **Database**     | `railway` (or your database name)                                    |
    | **Schema**       | `public` (default — change if your tables are in a different schema) |
    | **Username**     | `postgres`                                                           |
    | **Password**     | Your database password                                               |

    **For MySQL:**

    | Field            | Value                                                           |
    | ---------------- | --------------------------------------------------------------- |
    | **Display Name** | A name to identify this connection (e.g., "Railway Production") |
    | **Host**         | Your public proxy host (e.g., `roundhouse.proxy.rlwy.net`)      |
    | **Port**         | Your assigned proxy port (e.g., `43721`)                        |
    | **Database**     | `railway` (or your database name)                               |
    | **Username**     | `root`                                                          |
    | **Password**     | Your database 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>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection timed out">
    * Make sure you've enabled **TCP Proxy** in your database service settings. Without it, the database is only accessible from within Railway's private network
    * Verify you're using the **public** host and port from the Connect tab, not the private/internal ones. Internal URLs ending in `.railway.internal` won't work from outside Railway
    * Check that your Railway project is active and the database service is running
  </Accordion>

  <Accordion title="Wrong port">
    * Railway uses a **randomly assigned port** for the TCP proxy, not the standard `5432` (PostgreSQL) or `3306` (MySQL). Copy the exact port shown in the **Connect** tab under the public connection details
  </Accordion>

  <Accordion title="Authentication failed">
    * Double-check your username and password from the Railway **Connect** tab
    * PostgreSQL defaults to `postgres` as the username, MySQL defaults to `root`
    * You can view or reset credentials in the database service's **Variables** tab
  </Accordion>

  <Accordion title="No tables visible after connecting">
    * Confirm your tables are in the `public` schema (PostgreSQL). If they're in a custom schema, update the **Schema** field in VexiData
    * Check that you're connecting to the correct database name
  </Accordion>
</AccordionGroup>
