• Task
  • Version · 6.0
  • Create

Connect to Cloud SQL for MySQL using GCP IAM authentication

Last updated: September 29, 2026

Before you begin

Procedure

1

Add the MySQL JDBC driver

liquibase --version
2

Choose the identity Liquibase will authenticate as

gcloud config get-value project

gcloud projects list
loading
gcloud iam service-accounts list --format="value(email)"
3

Grant the Cloud SQL IAM roles

loading
4

Create the IAM database user

loading
gcloud sql users list --instance=your_instance_id
5

Grant database privileges

loading
6

Provide Google Cloud credentials

gcloud auth application-default login
loading
7

Configure the connection

8

(Optional) Impersonate a service account

loading
liquibase.cloudsql.targetServiceAccount: your_target_service_account
9

(Optional) Chain impersonation through delegates

liquibase.cloudsql.delegates: your_delegate_service_account
liquibase.cloudsql.targetServiceAccount: your_target_service_account
10

Create a changelog file

loading

loading

loading

loading
11

Test your connection

liquibase --changelog-file=changelog.xml status
liquibase --changelog-file=changelog.xml update
loading