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

# Google Cloud SQL

> Connect your Google Cloud SQL PostgreSQL, MySQL, MariaDB, or SQL Server database to VexiData.

## Prerequisites

* A [Google Cloud](https://console.cloud.google.com) account with a Cloud SQL instance
* A [VexiData](https://vexidata.com) account

## Connect Cloud SQL to VexiData

<Steps>
  <Step title="Enable Public IP on your instance">
    Your Cloud SQL instance must have a public IP address for VexiData to connect.

    1. Go to the [Cloud SQL Console](https://console.cloud.google.com/sql)
    2. Click on your instance
    3. Go to **Connections** > **Networking**
    4. Under **Public IP**, make sure it's enabled
    5. Copy the **Public IP address** from the instance overview page
  </Step>

  <Step title="Add VexiData to Authorized Networks">
    Cloud SQL blocks all external connections by default. You must add VexiData's IP addresses as Authorized Networks.

    1. In your instance's **Connections** > **Networking** tab
    2. Under **Authorized networks**, click **Add a network**
    3. Add each of VexiData's IPs:

    | Name     | Network            |
    | -------- | ------------------ |
    | VexiData | `46.101.71.122/32` |

    4. Click **Save**

    <Note>
      Authorized Networks are **mandatory**. Your connection will fail without this step.
    </Note>
  </Step>

  <Step title="Get your database credentials">
    1. Go to the **Users** tab on your instance
    2. Note your username (default: `postgres` for PostgreSQL)
    3. If you need to set or reset a password, click the user and choose **Change password**

    | Parameter    | PostgreSQL Example        | MySQL / MariaDB Example | SQL Server Example     |
    | ------------ | ------------------------- | ----------------------- | ---------------------- |
    | **Host**     | Your instance's Public IP | Same                    | Same                   |
    | **Port**     | `5432`                    | `3306`                  | `1433`                 |
    | **Database** | `postgres` (default)      | Your database name      | Your database name     |
    | **Username** | `postgres`                | Your username           | `sqlserver`            |
    | **Password** | Your database password    | Your database password  | Your database password |
  </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 instance type
    3. Fill in the details:

    | Field            | Value                                                                 |
    | ---------------- | --------------------------------------------------------------------- |
    | **Display Name** | A name to identify this connection (e.g., "Cloud SQL Production")     |
    | **Host**         | Your instance's Public IP address                                     |
    | **Port**         | `5432` (PostgreSQL), `3306` (MySQL / MariaDB), or `1433` (SQL Server) |
    | **Database**     | Your database name                                                    |
    | **Schema**       | `public` (PostgreSQL) or `dbo` (SQL Server)                           |
    | **Username**     | Your database username                                                |
    | **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>

<Info>
  You do **not** need the Cloud SQL Auth Proxy to connect VexiData. The Auth Proxy is for applications that can't use Authorized Networks — VexiData connects directly via Public IP.
</Info>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection timed out">
    * Verify VexiData's IP (`46.101.71.122/32`) is listed in **Authorized Networks**
    * Check that **Public IP** is enabled on your instance
    * Confirm the instance is running (not stopped)
  </Accordion>

  <Accordion title="Authentication failed">
    * Verify your username and password. Reset the password from the **Users** tab if needed
    * For PostgreSQL, the default user is `postgres`. For MySQL and MariaDB, check the user you created during setup. For SQL Server, the default user is `sqlserver`
  </Accordion>

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