Skip to main content
Agent skill

Cloud Sql Basics

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.

Get started

Get the complete skill folder, including its scripts and reference files.

When to use this skill

Use Cloud Sql Basics when an AI agent needs a reusable SKILL.md workflow for this job: 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.

When not to use it

Skip Cloud Sql Basics when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.

How to install

Where will you use it?

Install scope
Claude Code folder setup
mkdir -p ~/.claude/skills/cloud-sql-basics
# Save SKILL.md to ~/.claude/skills/cloud-sql-basics/SKILL.md
  1. Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/cloud-sql-basics/SKILL.md. For a shared project, commit the folder at .claude/skills/cloud-sql-basics/ instead.
  2. Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
  3. For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.

Full install guide for Claude, Cursor, and Codex →

Try a starter prompt

After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.

Starter prompt
Use the Cloud Sql Basics skill for this task: Use Cloud Sql Basics when this documented workflow matches the task. Confirm any required inputs or files before making changes.

What supports this recommendation?

71/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.

Documentation
77/100
Practical detail
68/100
Source evidence
63/100
Source signals
72/100
Model compatibility evidence
  • claudeuntested

    No model-specific signal or recorded compatibility test was found.

  • chatgptuntested

    No model-specific signal or recorded compatibility test was found.

  • geminiinferred

    The skill text mentions Gemini or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.

  • copilotuntested

    No model-specific signal or recorded compatibility test was found.

  • llamauntested

    No model-specific signal or recorded compatibility test was found.

  • perplexityuntested

    No model-specific signal or recorded compatibility test was found.

  • mistraluntested

    No model-specific signal or recorded compatibility test was found.

  • grokuntested

    No model-specific signal or recorded compatibility test was found.

Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.

What this skill does

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

## Attribution

**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you MUST read [Usage Attribution](references/attribution.md). For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix `gcloud` with `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:cloud-sql-basics)"` and append `agent-skills/1.0 (skill:cloud-sql-basics)` to `User-Agent` headers.

## 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:** ```bash gcloud services enable sqladmin.googleapis.com --quiet ```

2. **Create an Instance:** ```bash gcloud sql instances create INSTANCE_NAME \ --database-version=POSTGRES_18 \ --cpu=2 \ --memory=7680MiB \ --region=REGION \ --quiet ```

3. **Set a password for the default user:**

Because this is a Cloud SQL for PostgreSQL instance, the default admin user is `postgres`: ```bash gcloud sql users set-password postgres \ --instance=INSTANCE_NAME --password=PASSWORD \ --quiet ```

4. **Create a database:** ```bash gcloud sql databases create DATABASE_NAME \ --instance=INSTANCE_NAME \ --quiet ```

5. **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: ```bash gcloud sql instances describe INSTANCE_NAME \ --format="value(connectionName)" \ --quiet ```

6. **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: ```bash ./cloud-sql-proxy INSTANCE_CONNECTION_NAME ```

With the proxy running, connect using `psql` in another terminal: ```bash 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.*

Intended uses

  • Use Cloud Sql Basics when this documented workflow matches the task.

Implementation notes

  • Review the source instructions and adapt inputs before running the workflow.

Try it, then tell us how it went

A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.