> ## Documentation Index
> Fetch the complete documentation index at: https://midplane.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Cloud SQL

> Connect Cloud SQL for PostgreSQL or MySQL to Midplane: its public IP and authorized networks or a bastion, TLS without client certificates, its server CA, and the role script.

Cloud SQL for PostgreSQL and Cloud SQL for MySQL 8.4 connect; MySQL 8.0 is
refused. Midplane uses a plain connection string: no Cloud SQL Auth Proxy
or connector library.

**1. Let Midplane in**

By the instance's public IP, add `209.71.123.21/32` (EU) or `209.71.122.252/32` (US) to its
authorized networks, which take IPv4 only
([allowlists](https://midplane.ai/docs/connect/allowlist.md)). For a private IP only, use an
[SSH bastion](https://midplane.ai/docs/connect/ssh.md): a VM in the same VPC network.

**2. Allow TLS without client certificates**

Midplane presents none. SSL mode `ENCRYPTED_ONLY` admits it; requiring
trusted client certificates refuses it
([Cloud SQL's SSL/TLS settings](https://docs.cloud.google.com/sql/docs/postgres/configure-ssl-instance)).

**3. Paste the server CA**

Midplane doesn't carry Cloud SQL's CA. Download `server-ca.pem` from
the instance's connection settings, or:

```sh theme={null}
gcloud sql instances describe <instance> --format="value(serverCaCert.cert)" > server-ca.pem
```

Paste it in the connect form. The certificate must also name the host
you connect by: Cloud SQL's docs say which server CA modes put a DNS
name in it. By a bare IP address, the source may stay **Encrypted, not
verified**.

**4. Run the role script**

As `postgres` (PostgreSQL) or `root` (MySQL), on the primary for a
replica ([the role script](https://midplane.ai/docs/connect/role.md)).

More in Google's guide:
[authorized networks](https://docs.cloud.google.com/sql/docs/postgres/authorize-networks).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.