| name | cloud-sql-basics |
| description | 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. |
| source | google/skills (Apache 2.0) |
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: