cloud-sql-basics — Claude Code skill: install
This skill helps create and explain Cloud SQL resources for MySQL, PostgreSQL, and SQL Server. Use it when setting up a database in Google Cloud.
npx skills add google/skills --skill cloud-sql-basics -a claude-codeWhat cloud-sql-basics does
cloud-sql-basics guides an agent through Cloud SQL resources: creating instances and databases for MySQL, PostgreSQL, or SQL Server. It also covers backups, replicas, high availability, and secure connections for relational database workloads.
The skill includes a PostgreSQL walkthrough using gcloud: enable the API, create an instance and database, set the postgres password, retrieve the connection name, and connect through Cloud SQL Auth Proxy. Its reference material covers CLI commands, Python, Java, Node.js and Go connections, Terraform, IAM, SSL/TLS, backups, and MCP.
You need IAM access with the roles/cloudsql.admin role. The PostgreSQL connection example also requires Cloud SQL Auth Proxy and psql. Install it if an agent manages Cloud SQL resources; it is unnecessary for a regular local database.
What it helps with
- create a Cloud SQL instance for PostgreSQL
- set up a database and the
postgresuser password - retrieve an instance connection name
- connect to Cloud SQL through Auth Proxy
- find commands for IAM, Terraform, and backups
Example prompts for the agent
- Create a Cloud SQL PostgreSQL instance and a database named `DATABASE_NAME`.
- Enable the API, set the `postgres` password, and show the connection command using `cloud-sql-proxy`.
- Explain how to define a Cloud SQL instance and database in Terraform.
How to install cloud-sql-basics
1Skills CLI (Vercel)
npx skills add google/skills --skill cloud-sql-basics -a claude-code2Manually: put the files in place
~/.claude/skills/cloud-sql-basics/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/cloud-sql-basics/
1Skills CLI (Vercel)
npx skills add google/skills --skill cloud-sql-basics -a codex2Manually: put the files in place
.agents/skills/cloud-sql-basics/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/cloud-sql-basics/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install google/skills cloud-sql-basics2Manually: put the files in place
.github/skills/cloud-sql-basics/SKILL.md1Skills CLI (Vercel)
npx skills add google/skills --skill cloud-sql-basics -a gemini-cli2Platform CLI
gemini skills install https://github.com/google/skills --path skills/cloud/cloud-sql-basicsManually: put the files in place
.devin/skills/cloud-sql-basics/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set172
The whole set →Similar
Questions about cloud-sql-basics
How do I install cloud-sql-basics in Claude Code?
Run npx skills add google/skills --skill cloud-sql-basics -a claude-code. The skill file is placed at ~/.claude/skills/cloud-sql-basics/SKILL.md.
What does cloud-sql-basics do?
It helps an agent create and explain Cloud SQL resources for MySQL, PostgreSQL, and SQL Server. It provides guidance for instances, databases, users, and connections.
What is required to use this skill with Cloud SQL?
You need IAM access with the roles/cloudsql.admin role. The PostgreSQL connection example also requires Cloud SQL Auth Proxy and psql.
Source text
SKILL.md · Apache-2.0
---
name: cloud-sql-basics
metadata:
version: "1.0.1"
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.
## 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.*
© google · Apache-2.0 · google/skills