Cloud Sql Basics

作者 google55b4e13eba6d無授權條款21K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

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.

精選僅含說明DevOps & Cloud
AI 產生的概覽

說明並產生適用於 MySQL、PostgreSQL 與 SQL Server 的 Google Cloud SQL 資源。

功能
此技能提供建立與管理 Cloud SQL 執行個體、資料庫和使用者的說明與參考資料。內容涵蓋 gcloud CLI 快速入門、透過 Cloud SQL Auth Proxy 連線、IAM 角色、用戶端程式庫、Terraform、MCP 用法,以及備份與災難復原主題。它產出的是指引與指令範例,而非檔案或指令碼。
適用情境
當使用者要求建立或說明適用於 MySQL、PostgreSQL 或 SQL Server 的 Cloud SQL 執行個體或資料庫時使用。它也適合用於 Cloud SQL 連線、IAM 權限、備份、高可用性或基礎架構即程式碼相關問題。
執行需求
需要具備 Cloud SQL Admin IAM 權限的 Google Cloud 存取權、gcloud CLI,以及用於連線的 Cloud SQL Auth Proxy。參考資料也涵蓋用戶端程式庫、Terraform 與 MCP 用法。未隨附指令碼,僅為說明與參考資料。

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:

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

  • CLI Usage [blocked]: Essential gcloud sql commands for instance, database, and user management.

  • Client Libraries & Connectors [blocked]: Connecting to Cloud SQL using Python, Java, Node.js, and Go.

  • MCP Usage [blocked]: Using the Cloud SQL remote MCP server and Gemini CLI extension.

  • Infrastructure as Code [blocked]: Terraform configuration for instances, databases, and users.

  • IAM & Security [blocked]: Predefined roles, SSL/TLS certificates, and Auth Proxy configuration.

  • Disaster Recovery & Backups [blocked]: 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/skills位於skills/cloud/cloud-sql-basics提交55b4e13

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 google/skills 的技能

Dpop Adoption

google

精選

指導為 Google OAuth 平台實作 OAuth 2.0 DPoP(RFC 9449)傳送方約束的更新權杖。

Security21K今天更新

Finding Google Skills

google

精選

Google platform decision and setup guidance, loaded on demand from Google's skill catalog. Use when a developer is choosing or setting up part of their stack, such as where to run a service, a database, storage, messaging, authentication, analytics, ads, or AI model serving, and a Google product is a reasonable candidate - whether or not a vendor is named - or when a request names a Google product or API. Brings in the matching Google skill so the answer can weigh Google options, their trade-offs, and when they are not the right fit. Skip when the stack is already settled on another provider and no Google product is named, or the task involves no platform choice.

待分類21K今天更新

Spanner Basics

google

精選

指導 Google Cloud Spanner 的執行個體與資料庫管理、結構定義設計、查詢與效能診斷。

Data & Analytics21K今天更新

Secops Triage

google

精選

引導 SOC 分析師對 Google SecOps 安全警示進行分診,從調查到結案或升級。

Security21K今天更新

Secops Investigate

google

精選

指導 SOC 分析師在 Google SecOps 中使用 UDM 查詢與時間軸進行深入的安全事件與實體調查。

Security21K今天更新

Secops Hunt

google

精選

指導在 Google SecOps 中使用 UDM 查詢、IoC 回溯、普遍性與異常分析進行主動威脅狩獵。

Security21K今天更新