PluginBench
Skill
Pass
Audit score 90

cloud-sql-basics

google/skills

Fully managed relational database service for MySQL, PostgreSQL, and SQL Server on Google Cloud.

What is cloud-sql-basics?

Cloud SQL is a managed relational database service that automates patches, updates, backups, and replicas for MySQL, PostgreSQL, and SQL Server. Use it when you need to create and manage database instances without handling infrastructure maintenance.

  • Create and manage Cloud SQL instances for MySQL, PostgreSQL, or SQL Server
  • Automate backups, patches, updates, and high-availability replicas
  • Connect securely using Cloud SQL Auth Proxy with SSL/TLS encryption
  • Set up databases and manage users with gcloud CLI commands
  • Configure disaster recovery with Point-in-Time Recovery (PITR) and read pools

How to install cloud-sql-basics

npx skills add https://github.com/google/skills --skill cloud-sql-basics
Prerequisites
  • Google Cloud project with billing enabled
  • gcloud CLI installed and authenticated
  • Cloud SQL Admin IAM role (roles/cloudsql.admin) or equivalent permissions
  • Cloud SQL API enabled in your project
Claude Code
Cursor
Windsurf
Cline

How to use cloud-sql-basics

  1. 1.Enable the Cloud SQL API using gcloud services enable sqladmin.googleapis.com
  2. 2.Create an instance with gcloud sql instances create specifying database version, CPU, memory, and region
  3. 3.Set a password for the default user (postgres, mysql_root, or sa depending on engine)
  4. 4.Create a database within the instance using gcloud sql databases create
  5. 5.Retrieve the instance connection name formatted as PROJECT_ID:REGION:INSTANCE_NAME
  6. 6.Start the Cloud SQL Auth Proxy with the connection name to enable local connections
  7. 7.Connect using your preferred client (psql for PostgreSQL, mysql for MySQL, etc.) or application driver

Use cases

Good for
  • Provision a PostgreSQL instance for a new application with automated backups
  • Set up high-availability MySQL database with read replicas for scaling
  • Create SQL Server instance with disaster recovery and PITR enabled
  • Connect applications via client libraries (Python, Java, Node.js, Go) to Cloud SQL
  • Manage database infrastructure as code using Terraform
Who it's for
  • Backend engineers deploying relational databases on Google Cloud
  • DevOps teams managing database infrastructure and disaster recovery
  • Application developers needing managed database services without ops overhead
  • Teams using Terraform or infrastructure-as-code for database provisioning

cloud-sql-basics FAQ

Which database engines does Cloud SQL support?

Cloud SQL supports MySQL, PostgreSQL, and SQL Server. Each is fully managed with automated backups, patches, and high-availability options.

What is the Cloud SQL Auth Proxy and why do I need it?

The Auth Proxy is a secure tunnel that handles authentication and encryption when connecting to Cloud SQL instances. It must be running locally to establish connections from your application or client tools.

How do I connect from my application code?

Cloud SQL provides client libraries for Python, Java, Node.js, and Go. You can also use standard database drivers with the Auth Proxy or Cloud SQL connectors for language-specific frameworks.

What backup and disaster recovery options are available?

Cloud SQL supports automated backups, Point-in-Time Recovery (PITR), read replicas for scaling, and Enterprise Plus Advanced DR for cross-region failover.

Can I manage Cloud SQL with infrastructure-as-code tools?

Yes, Terraform is fully supported for creating and managing Cloud SQL instances, databases, users, and configurations as code.

Full instructions (SKILL.md)

Source of truth, from google/skills.


name: cloud-sql-basics metadata: version: "1.0.0" 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
    
  2. Create an Instance:

    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:

    gcloud sql users set-password postgres \
      --instance=INSTANCE_NAME --password=PASSWORD \
      --quiet
    
  4. Create a database:

    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:

    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:

    ./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: Cloud SQL editions (Enterprise & Enterprise Plus), instance architecture, read pools, high availability (HA), and supported database engines.

  • CLI Usage: Essential gcloud sql commands 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.