gcloud sql users create accepts --database-roles
Introduced 2026-02-03 · score 0.95
HOW TO USE IT
For a Cloud SQL MySQL or PostgreSQL instance, create a user with `gcloud sql users create` and pass `--database-roles` to assign roles during creation.
gcloud sql users create <USERNAME> --instance=<INSTANCE> --database-roles=<ROLE_1>,<ROLE_2>WHY THIS HELPS
Create a Postgres or MySQL user with additional database roles.
REQUIREMENTS AND LIMITATIONS
- USERNAME (required): Cloud SQL username.
- --instance=INSTANCE (required): Cloud SQL instance ID.
- --database-roles=ROLE,…: Comma-separated roles to assign; available only for MySQL and PostgreSQL instances. Roles can be predefined or custom.
- Prerequisite: Any custom roles must already exist in the database; create them with `CREATE ROLE`.
- Applies to Postgres and MySQL.
FIRST-PARTY EVIDENCE
- https://docs.cloud.google.com/sdk/docs/release-notes#55500_2026-02-03
- https://docs.cloud.google.com/sdk/gcloud/reference/sql/users/create
Check the installed version and the source before using it. Entry JSON