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- 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
How to use cloud-sql-basics
- 1.Enable the Cloud SQL API using gcloud services enable sqladmin.googleapis.com
- 2.Create an instance with gcloud sql instances create specifying database version, CPU, memory, and region
- 3.Set a password for the default user (postgres, mysql_root, or sa depending on engine)
- 4.Create a database within the instance using gcloud sql databases create
- 5.Retrieve the instance connection name formatted as PROJECT_ID:REGION:INSTANCE_NAME
- 6.Start the Cloud SQL Auth Proxy with the connection name to enable local connections
- 7.Connect using your preferred client (psql for PostgreSQL, mysql for MySQL, etc.) or application driver
Use cases
- 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
- 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
Cloud SQL supports MySQL, PostgreSQL, and SQL Server. Each is fully managed with automated backups, patches, and high-availability options.
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.
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.
Cloud SQL supports automated backups, Point-in-Time Recovery (PITR), read replicas for scaling, and Enterprise Plus Advanced DR for cross-region failover.
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)
-
Enable the API:
gcloud services enable sqladmin.googleapis.com --quiet -
Create an Instance:
gcloud sql instances create INSTANCE_NAME \ --database-version=POSTGRES_18 \ --cpu=2 \ --memory=7680MiB \ --region=REGION \ --quiet -
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 -
Create a database:
gcloud sql databases create DATABASE_NAME \ --instance=INSTANCE_NAME \ --quiet -
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 -
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_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.
Related skills
More from google/skills and the wider catalog.

data-manager-api-audience-ingestion
Manage audience members for Google Ads and Display & Video 360 using the Data Manager API.

data-manager-api-event-ingestion
Ingest offline conversions, enhanced conversions, and events into Google Ads, Analytics, and Floodlight via the Data Manager API.

data-manager-api-setup
Set up Data Manager API client libraries and authentication for your local environment.

datalineage-bigquery-asset-impact-analysis
Analyze downstream impact and dependencies when BigQuery tables or views change.

datalineage-summary
Summarize Google Cloud Data Lineage graphs to debug data quality and understand data provenance.

detection-engineering-coverage-evaluation
Automate detection engineering workflows in Google SecOps: generate TDOs, synthetic events, and evaluate rule coverage.