Cloud SQL Basics
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Cloud SQL Basics provides a structured approach to managing fully managed relational database services on Google Cloud, including MySQL, PostgreSQL, and SQL Server. It covers the lifecycle of database resources, from initial creation and configuration to operational tasks like backups, high availability, and secure connectivity via the Cloud SQL Auth Proxy. The skill emphasizes best practices for resource management, IAM security, and infrastructure-as-code integration.
What it does
- Provision and configure Cloud SQL instances for MySQL, PostgreSQL, and SQL Server.
- Manage database users, including IAM-based authentication and static password setup.
- Perform operational tasks such as creating backups and restoring instances.
- Retrieve connection details for secure access via the Cloud SQL Auth Proxy.
- Provide guidance on high availability, read replicas, and read pool configurations.
- Offer reference material for Terraform integration and client library connectivity.
When to use it
- When you need to deploy a new managed relational database on Google Cloud.
- When performing routine administrative tasks like creating databases or managing user access.
- When setting up secure connectivity between your application and a Cloud SQL instance.
- When implementing disaster recovery strategies such as backups and point-in-time recovery.
- When scaling database performance using read replicas or read pools.
Advantages
- Simplifies complex database management tasks through standardized CLI commands.
- Ensures secure connectivity patterns by integrating with the Cloud SQL Auth Proxy.
- Provides clear paths for both manual CLI management and automated infrastructure-as-code.
- Includes mandatory usage attribution to help track and optimize cloud resource interactions.
Usage examples
- “Create a new PostgreSQL instance named my-db-instance in us-central1.”
- The agent will execute the gcloud sql instances create command with the specified configuration, enabling the necessary API and setting up the instance.
- “How do I connect to my Cloud SQL instance securely?”
- The agent will guide you through retrieving the instance connection name and starting the Cloud SQL Auth Proxy to establish a secure connection.
- “Create a new database named inventory inside my existing instance.”
- The agent will run the gcloud sql databases create command to provision the new database within the specified instance.
- “How can I restore my database from a specific backup?”
- The agent will provide the gcloud sql backups restore command, explaining how to target either the original or a new instance for the restoration.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/google/cloud-sql-basics/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip cloud-sql-basics.zip -d .agents/skills
Documentation by Google
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. 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)
Enable the API:
gcloud services enable sqladmin.googleapis.com --quietCreate an Instance:
gcloud sql instances create INSTANCE_NAME \ --database-version=POSTGRES_18 \ --cpu=2 \ --memory=7680MiB \ --region=REGION \ --quietSet 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 \ --quietCreate a database:
gcloud sql databases create DATABASE_NAME \ --instance=INSTANCE_NAME \ --quietGet 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)" \ --quietConnect 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_NAMEWith the proxy running, connect using
psqlin another terminal:psql "host=127.0.0.1 port=5432 user=postgres dbname=DATABASE_NAME password=PASSWORD sslmode=disable"
Reference Directory
Core Concepts: Cloud SQL editions (Enterprise & Enterprise Plus), instance architecture, read pools, high availability (HA), and supported database engines.
CLI Usage: Essential
gcloud sqlcommands for instance, database, and user management.Client Libraries & Connectors: Connecting to Cloud SQL using Python, Java, Node.js, and Go.
MCP Usage: Using the Cloud SQL remote MCP server and Gemini CLI extension.
Infrastructure as Code: Terraform configuration for instances, databases, and users.
IAM & Security: Predefined roles, SSL/TLS certificates, and Auth Proxy configuration.
Disaster Recovery & Backups: 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.
Files
- ATTRIBUTION.mdAdded by AutoGineer850 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md4.2 KiB
- references/attribution.md1.8 KiB
- references/cli-usage.md3.3 KiB
- references/client-library-usage.md2.9 KiB
- references/core-concepts.md5.4 KiB
- references/dr-backups.md7.3 KiB
- references/iac-usage.md2.7 KiB
- references/iam-security.md12.6 KiB
- references/mcp-usage.md3.2 KiB
references/core-concepts.md
Cloud SQL Core Concepts
Cloud SQL provides managed relational databases, abstracting the underlying infrastructure while offering standard database engines.
Cloud SQL Editions
Cloud SQL offers tier-based pricing and feature editions tailored to different performance, availability, and operational requirements:
Cloud SQL Enterprise Edition:
Target Workloads: Core business applications requiring standard managed database capabilities.
Availability SLA: 99.95% (excludes planned maintenance).
Performance & Hardware: Shared core VMs (up to 1 vCPU, 1.7 GB RAM) or Dedicated core VMs (up to 96 vCPU, 624 GB RAM, or N4 up to 80 vCPU / 624 GB RAM).
Maintenance Downtime: Standard maintenance impact (< 30 seconds).
Point-in-Time Recovery (PITR): Up to 7 days of log retention.
Cloud SQL Enterprise Plus Edition:
Target Workloads: Mission-critical workloads requiring highest availability, maximum read performance, and minimal operational downtime.
Availability SLA: 99.99% (includes planned maintenance).
Performance & Hardware: Powered by high-performance machine series (N2, C4A up to 128 vCPU / 864 GB RAM) and SSD-based Data Cache for up to 4x improved read performance.
Maintenance Downtime: Sub-second downtime (< 1 second) for maintenance and planned scaling operations.
Enterprise Features: Exclusive support for Read Pools, Managed Connection Pooling, Advanced Disaster Recovery (DR) with cross-region write endpoints, and 35-day PITR log retention.
Upgrades: Supports in-place edition upgrades from Enterprise with minimal or sub-second downtime.
Supported Engines
Cloud SQL supports the following database engines (see supported versions):
MySQL: Versions 5.6, 5.7, 8.0, and 8.4.
PostgreSQL: Versions 9.6, 10, 11, 12, 13, 14, 15, 16, 17, and 18 (default).
SQL Server: 2017 (Express, Web, Standard, Enterprise), 2019, 2022, and 2025 (Express, Enterprise, Standard).
Instance Architecture
Each Cloud SQL instance is powered by a virtual machine (VM) running the database program.
Primary Instance: The main read/write connection point.
High Availability (HA): Provides a standby VM in a different zone with automatic failover.
Read Replicas: Used to scale read traffic and provide local access in different regions (individual single-node instances).
Read Pools: Multi-node load-balanced groups of read nodes designed for high-concurrency read workloads.
Edition Requirement: Supported exclusively on Cloud SQL Enterprise Plus edition on the new network architecture.
Node Capacity & Limits:
MySQL & PostgreSQL: 1 to 20 read pool nodes.
SQL Server: 1 to 7 read pool nodes.
The combined total of standalone read replicas and read pool nodes per primary instance cannot exceed 20 (MySQL/PostgreSQL) or 7 (SQL Server).
Scaling Options:
Manual Scaling: Sub-second downtime for manual scale-out/scale-in (adding or removing nodes) and scale-up/scale-down (changing node machine tiers).
Autoscaling: Dynamically adjusts node counts between specified
--auto-scale-min-node-countand--auto-scale-max-node-countthresholds based onAVERAGE_CPU_UTILIZATIONorAVERAGE_DB_CONNECTIONS. Supports configurable cooldown periods (default 600s, minimum 60s) and optional scale-in disabling (--auto-scale-disable-scale-in).
High Availability & SLA: Pools with 2 or more nodes are covered under the Cloud SQL SLA, with nodes distributed across zones within the region.
Routing & Consistency: Routes traffic based on node process health regardless of replication lag. Logical sessions connecting across requests are not guaranteed read-your-own-writes consistency across different nodes (LSN/GTID progress may differ).
Topology: Must replicate directly from the primary instance (cascading read pools or cascading replicas to read pools are not supported).
Storage and Networking
Persistent Disk: Scalable and durable network storage attached to the VM.
Connectivity: Supports Private IP (using VPC peering for MySQL and PostgreSQL only; or using private services access or Private Service Connect for all Cloud SQL engines) and Public IP (with authorized networks or Auth Proxy).
Pricing
Cloud SQL pricing is based on:
Instance Type: vCPUs and RAM.
Storage: Amount of data stored and IOPS.
Networking: Network egress and IP address usage.
DNS pricing: Charge is per zone per month (regardless of whether you use your zone). You also pay for queries against your zones.
Licensing: Applies to SQL Server only. In addition to instance and resource pricing, SQL Server also has a licensing component. High availability, or regional instances, will only incur the cost for a single license for the active resource. As a managed service, Cloud SQL does not support BYOL (Bring your own license).
For the latest pricing, visit: Cloud SQL Pricing.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs a command-line tool
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/cloud/cloud-sql-basics · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google or Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cloud-sql-basics.zip