Skip to content
Cloud SQL Basics

Cloud SQL Basics Skill

Google's official Cloud SQL skill — create and connect MySQL, PostgreSQL and SQL Server instances with the right gcloud commands, Auth Proxy setup, HA and backup model.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from google/skills.

$ npx skills add google/skills --skill cloud-sql-basics

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/cloud-sql-basics/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/google/skills.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/skills/cloud/cloud-sql-basics ~/.claude/skills/cloud-sql-basics

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/cloud-sql-basics/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Working quick start: instance, admin password, database, connection name, Auth Proxy, psql
  • Edition comparison — Enterprise vs Enterprise Plus, read pools and high availability
  • Connector and client-library guidance for Python, Java, Node.js and Go
  • Terraform resources for instances, databases and users
  • Disaster recovery: backup types, PITR, replicas and Advanced DR

Cloud SQL is Google Cloud's managed relational database for MySQL, PostgreSQL and SQL Server. The gap agents fall into is not the SQL — it is everything around it: which gcloud sql flags actually exist, why a psql connection hangs without the Auth Proxy running, and which edition you need before high availability or read pools are even an option.

This skill from Google's official skills repository walks the whole first path end to end: enabling the Admin API, creating an instance with a concrete machine shape, setting the default admin user's password, creating a database, retrieving the PROJECT:REGION:INSTANCE connection name, starting cloud-sql-proxy, and connecting through it. Each step is a command the agent can run rather than a description of a console screen.

Behind that sits a reference directory the agent pulls in on demand: Enterprise versus Enterprise Plus editions, instance architecture, read pools and high availability; the full gcloud sql command surface for instances, databases and users; connectors and client libraries for Python, Java, Node.js and Go; the Cloud SQL remote MCP server and Gemini CLI extension; Terraform for instances, databases and users; predefined IAM roles, SSL/TLS certificates and Auth Proxy configuration; and the disaster-recovery model — backup types, point-in-time recovery, replicas and Enterprise Plus Advanced DR.

Reach for it when an agent is provisioning a Cloud SQL instance, debugging a connection that will not open, or reviewing whether an existing setup can actually survive a zone failure.

Try it

Once installed, ask your agent something like:

"Provision a highly available Cloud SQL for PostgreSQL instance in europe-west1, create an app database and user, and show me how to connect from a local machine through the Auth Proxy."

SKILL.md

The instructions your agent loads, as published by Google.

SKILL.md
name
cloud-sql-basics
metadata
category: Databases
description
This file generates or explains Cloud SQL resources. Use this file when the user asks to create a Cloud SQL instance or database for MySQL, PostgreSQL, or SQL Server. Cloud SQL manages third-party MySQL, PostgreSQL, and SQL Server instances as resources in Cloud SQL. For example, when Cloud SQL creates an open-source MySQL instance, the resulting resource is a Cloud SQL for MySQL instance that Google Cloud manages. Cloud SQL handles backups, high availability, and secure connectivity for relational database workloads.

Cloud SQL Basics

Cloud SQL is a fully managed relational database service for MySQL, PostgreSQL,
and SQL Server. It automates time-consuming tasks like patches, updates,
backups, and replicas, while providing high performance and availability for
your applications.

Prerequisites

Ensure you have the necessary IAM permissions to create and manage Cloud SQL
instances. The Cloud SQL Admin (roles/cloudsql.admin) role provides full
access to Cloud SQL resources.

Quick Start (PostgreSQL)
  1. Enable the API:
    gcloud services enable sqladmin.googleapis.com --quiet
  1. Create an Instance:
    gcloud sql instances create INSTANCE_NAME \
      --database-version=POSTGRES_18 \
      --cpu=2 \
      --memory=7680MiB \
      --region=REGION \
      --quiet
  1. Set a password for the default user:

Because this is a Cloud SQL for PostgreSQL instance, the default admin user
is postgres:

    gcloud sql users set-password postgres \
      --instance=INSTANCE_NAME --password=PASSWORD \
      --quiet
  1. Create a database:
    gcloud sql databases create DATABASE_NAME \
      --instance=INSTANCE_NAME \
      --quiet
  1. Get the instance connection name:

You need the instance connection name (which is formatted as
PROJECT_ID:REGION:INSTANCE_NAME) to connect using the Cloud SQL Auth
Proxy. Retrieve it with the following command:

    gcloud sql instances describe INSTANCE_NAME \
      --format="value(connectionName)" \
      --quiet
  1. Connect to the instance:

The Cloud SQL Auth Proxy must be running to be able to connect to the
instance. In a separate terminal, start the proxy using the connection name:

    ./cloud-sql-proxy INSTANCE_CONNECTION_NAME

With the proxy running, connect using psql in another terminal:

    psql "host=127.0.0.1 port=5432 user=postgres dbname=DATABASE_NAME password=PASSWORD sslmode=disable"
Reference Directory
  • [Core Concepts](references/core-concepts.md): Cloud SQL editions (Enterprise

& Enterprise Plus), instance architecture, read pools, high availability (HA),
and supported database engines.

  • [CLI Usage](references/cli-usage.md): Essential gcloud sql commands for

instance, database, and user management.

  • [Client Libraries & Connectors](references/client-library-usage.md):

Connecting to Cloud SQL using Python, Java, Node.js, and Go.

  • [MCP Usage](references/mcp-usage.md): Using the Cloud SQL remote MCP

server and Gemini CLI extension.

  • [Infrastructure as Code](references/iac-usage.md): Terraform

configuration for instances, databases, and users.

  • [IAM & Security](references/iam-security.md): Predefined roles, SSL/TLS

certificates, and Auth Proxy configuration.

  • [Disaster Recovery & Backups](references/dr-backups.md): Backup types,

Point-in-Time Recovery (PITR), replicas, read pools comparison, and Enterprise Plus Advanced DR.

*If you need product information not found in these references, use the
Developer Knowledge MCP server search_documents tool.*

Install
Browse all skills →