GCP Cloud SQL

Connect a PostgreSQL or MySQL database hosted on GCP Cloud SQL.

This guide covers the GCP-specific pieces. The SMAQ connection form is the same as any SQL database.

Step 1 — Collect connection details from Cloud SQL

In the GCP Console:

  1. SQL → Instances → click your instance.

  2. From the Overview tab, copy the Public IP address (or set up a Private IP — see Step 2).

  3. From Databases, note the DB name.

[Screenshot needed] Cloud SQL instance overview with Public IP visible.

Step 2 — Make the database reachable from SMAQ

Pick one:

  • Option A — Authorized networks (simplest)

    1. Get SMAQ's outbound IPs from [email protected].

    2. Cloud SQL instance → Connections → Networking → Authorized networks.

    3. Add each SMAQ IP with a descriptive name.

    4. Save.

  • Option B — Private IP + VPC peering (enterprise) Contact [email protected].

Step 3 — Create a read-only DB user

Use the GCP Console (Users tab) or psql/mysql client.

Postgres:

MySQL:

Step 4 — Add the connection in SMAQ

  1. SMAQ project → Data Source → Add data source.

  2. Pick PostgreSQL or MySQL.

  3. Fill in:

    • Host: Cloud SQL public IP (or Private IP if using VPC peering)

    • Port: 5432 / 3306

    • Database, Username, Password

    • SSL mode: Require (Cloud SQL has SSL on by default)

  4. Test connectionConnect.

Troubleshooting

  • Timeout — Cloud SQL Authorized networks doesn't include SMAQ's IPs, or the instance is set to Private IP only without peering.

  • SSL errors — Cloud SQL exposes a server certificate. SMAQ accepts the default certificate chain; if you've enabled "Require client certificates," you'll need VPC peering instead.

  • BigQuery — for GCP's serverless warehouse, use the BigQuery connector instead of Cloud SQL.

Last updated