cloud-sql-basics
它能做什么
这个技能帮你的 AI 智能体在 Google Cloud 上设置托管的关系型数据库。适合希望以更少维护工作托管 MySQL、PostgreSQL 或 SQL Server 的开发者。
适用场景
- ✓当你需要在 Google Cloud 上创建新的 Cloud SQL 数据库实例时。
- ✓当你想为应用设置密码、创建数据库或获取连接名称时。
- ✓当你想规划数据库的备份、高可用或安全连接时。
技能链接
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/database/cloud-sql-basics/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我的应用在 europe-west1 的 Google Cloud 上设置一个 PostgreSQL 数据库。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体运行 gcloud 命令来启用服务、创建实例、添加数据库并设置用户密码。它还会说明如何找到应用所需的连接名称。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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 --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: Instance architecture, 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.
If you need product information not found in these references, use the
Developer Knowledge MCP server search_documents tool.
常见问题
我需要什么权限?
你需要 Cloud SQL Admin 角色或同等权限,才能创建和管理实例。
它支持哪些数据库?
支持 MySQL、PostgreSQL 和 SQL Server。
Google 会处理更新吗?
会。该服务会自动完成补丁、更新和备份等任务。
详情
作者的原始描述
Creates and manages Cloud SQL instances for MySQL, PostgreSQL, and SQL Server. Handles backups, high availability, and secure connectivity for relational database workloads on Google Cloud.
热度
- GitHub 星标
- 33k
- 排名
- #8715
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。