Overview
What is Cloud SQL for MySQL: Cloud SQL for MySQL is a fully managed relational database service from Google Cloud for teams running MySQL workloads. Google Cloud describes the service as a way to "set up, maintain, manage, and administer your MySQL relational databases on Google Cloud." The service automates backups, replication, patches, and storage capacity increases.

How to integrate Google Cloud SQL for MySQL with Datagrid
Configure Cloud SQL access first, then add Datagrid credentials and select the sync path that matches the workflow. The integration lets Datagrid agents query MySQL tables, views, and SQL results, then route the output to warehouses, CRM systems, or cloud storage.
Configure Cloud SQL access
Start by preparing the Cloud SQL instance for MySQL protocol access. The Cloud SQL Auth Proxy provides secure access without manual SSL setup.
Enable the Cloud SQL Admin API in your project with gcloud services enable sqladmin.googleapis.com.
Create a service account with a role that includes the cloudsql.instances.connect permission.
Deploy the Cloud SQL Auth Proxy. Allow outgoing TCP to ports 443 and 3307. Add the --private-ip flag for private IP instances.
Access requirements for the connection path:
Cloud SQL Admin API: sqladmin.googleapis.com
Required permission: cloudsql.instances.connect
Outbound TCP ports: 443, 3307
Private IP instance flag: --private-ip
Authenticate Datagrid
After Cloud SQL access is ready, configure the MySQL integration in Datagrid.
In Datagrid, open Settings > Integrations > Add New and select the MySQL integration.
Enter the instance host, database name, and credentials.
Map the tables and views your agents will read.
Datagrid source definitions use the same connection fields:
datagrid_mysql_connection:
instance_host: "<instance host>"
database_name: "<database name>"
credentials: "<database credentials>"
readable_objects:
- tables
- views
connection_path: "Cloud SQL Auth Proxy or private IP"Cloud SQL supports IAM database authentication, which maps Cloud IAM principals to database roles. The Google Cloud Console enables the cloudsql_iam_authentication flag by default. Context-aware access creates one conflict. If context-aware access is enabled, Cloud SQL integrations cannot be used with IAM database authentication, so a direct connection is required. The Auth Proxy obtains ephemeral SSL certificates valid about one hour and refreshes them automatically.
Sync Cloud SQL data
Choose a sync pattern based on whether agents need direct read-write access, batch movement, or change data capture. Agents read tables, rows, columns, and query results directly over the MySQL protocol.
sync_patterns:
direct_jdbc: "Bidirectional reads and writes."
serverless_exports: "Unidirectional SQL dumps and CSV files to Cloud Storage."
datastream_cdc: "One-way inserts, updates, and deletes into BigQuery or Cloud Storage."For batch movement, serverless exports write SQL dumps and CSV files to Cloud Storage, and these run unidirectionally. For change data capture, Datastream streams inserts, updates, and deletes one way. Targets are BigQuery or Cloud Storage. Direct JDBC reads and writes are bidirectional.
The JDBC MySQL integration is the Datagrid connection bridge when agents need direct Cloud SQL reads and writes.
Why use Google Cloud SQL for MySQL with Datagrid
Connecting Cloud SQL for MySQL to Datagrid gives operators and project teams a way to turn database records into executed workflows. Here are reasons to integrate Google Cloud SQL for MySQL with Datagrid:
Schema-aware querying: Agents map fields across schema versions and adapt mappings when source schemas drift, so pipelines survive table changes.
Free-text classification: Agents read free-text columns like support tickets and product descriptions, then write back classification labels such as sentiment and urgency.
Continuous data profiling: Agents compute row counts, null rates, and referential integrity metrics on a schedule, then flag anomalies before bad data reaches analytics.
Near-real-time analytics feed: Datastream replicates MySQL changes into BigQuery using the Storage Write API UPSERT to keep warehouse tables current.
What you can build with Google Cloud SQL for MySQL and Datagrid
Datagrid agents can execute database-backed work in analytics workflows, data quality checks, and operational systems. The patterns below show when agents should query directly, classify records, synchronize changes, or monitor quality:
Automated ETL to analytics destinations: Build an agent that queries MySQL tables on schedule, applies business rules, and loads results into BigQuery.
Record classification and entity extraction: Build an agent that reads rows with free-text fields, classifies each record by sentiment or category, and writes structured labels back.
MySQL as canonical store with cross-platform sync: Use MySQL as the source of truth.
Data quality monitoring and anomaly detection: Build an agent that profiles tables on a recurring schedule. The agent compares current metrics to historical baselines and triggers remediation when profiles deviate.
Resources and documentation
Cloud SQL introduction explains the managed MySQL service, supported editions, and core administration scope.
IAM database authentication documentation covers automatic and manual IAM database auth.
Frequently asked questions
What MySQL versions does the Datagrid integration support?
Datagrid connects to Cloud SQL for MySQL instances running MySQL 5.6, 5.7, and 8.0 on Enterprise edition, as well as MySQL 8.0 on Enterprise Plus. For Datastream CDC pipelines, the source instance must run MySQL version 8.0.14 or later.
How do Datagrid agents access Cloud SQL data?
Datagrid agents connect through the standard MySQL wire protocol using either the Cloud SQL Auth Proxy or a private IP connection. Agents read tables, views, rows, columns, and query results directly, then write classifications, embeddings, or transformed records back to the database or out to connected platforms.
Does Datagrid support IAM database authentication?
Yes. Cloud SQL maps Cloud IAM principals to database roles, and the Auth Proxy handles ephemeral SSL certificates and IAM token refresh automatically. Note that if context-aware access is enabled, Cloud SQL integrations cannot be used with IAM database authentication, so a direct connection is required.
Similar integrations
JDBC MySQL: JDBC MySQL is the JDBC bridge for reading and writing MySQL data. It supports Cloud SQL via the Auth Proxy or private IP.
BigQuery: BigQuery is the primary analytics destination for Cloud SQL CDC and exports. It supports near-real-time replication and federated queries for reporting and ML workflows.
Databricks: Databricks is an analytics compute destination for ETL from Cloud SQL. It supports transformation, feature engineering, and model training on MySQL-origin data.
Snowflake: Cloud data warehouse alternative for ingesting Cloud SQL exports or CDC streams to centralize analytics and BI across systems.
Google Cloud Storage: Standard staging and export target for SQL dumps and CSV exports, used with Datastream or serverless exports from Cloud SQL.
Google Cloud SQL - PostgreSQL: Sibling Cloud SQL product for PostgreSQL useful when migrating, replicating, or comparing schema and performance against MySQL instances.