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:
SQL → Instances → click your instance.
From the Overview tab, copy the Public IP address (or set up a Private IP — see Step 2).
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)
Get SMAQ's outbound IPs from info@smaq.io.
Cloud SQL instance → Connections → Networking → Authorized networks.
Add each SMAQ IP with a descriptive name.
Save.
Option B — Private IP + VPC peering (enterprise) Contact info@smaq.io.
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
SMAQ project → Data Source → Add data source.
Pick PostgreSQL or MySQL.
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)
Test connection → Connect.
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.
Related
BigQuery — for GCP's serverless warehouse, use the BigQuery connector instead of Cloud SQL.
Last updated