Connect to Google Cloud SQL for MySQL

Connect Data Studio to Google Cloud SQL databases.

Cloud SQL for MySQL is a fully-managed database service that makes it easy to set-up, maintain, manage and administer your relational MySQL databases on Cloud Platform. The Cloud SQL for MySQL connector allows you to access data from Cloud SQL for MySQL databases within Data Studio.

In this article:

How to connect to Cloud SQL for MySQL

A Data Studio data source can connect to a single Cloud SQL for MySQL database table.

Supported versions

We've tested Data Studio on the following MySQL versions:

  • 5.6
  • 5.7
  • 8.0

If you experience issues using a supported version, please let us know in the Data Studio Help Community. You can add and vote on feature requests here.

Permissions

You must have at least cloudsql.client permission in the Cloud SQL for MySQL project to create the connection. If you don't have (or can't get) this access, you can use the MySQL connector instead.

Public IP

Data Studio only supports Cloud SQL for MySQL instances with public IP connectivity. Please configure public IP connectivity for your Cloud SQL for MySQL instance.

To connect

  1. Sign in to Data Studio.
  2. In the top left, click Create, then select Data Source.
  3. Select the Cloud SQL for MySQL connector.
  4. Select a connection option (described below) and provide your connection details.
  5. Configure access to your database using one of the connection options (see below).
  6. Click AUTHENTICATE.
    1. You will see a list of tables in that database.
    2. Select a table.
  7. In the upper right, click CONNECT.
    1. The data source fields panel appears.
    2. The data source is now connected to your data set.

You can now access all of the columns in the table as fields in your reports.

Connection options

BASIC

Connecting with a Cloud SQL for MySQL instance connection name requires the following information:

  • Instance Connection Name
  • Database
  • Username
  • Password

JDBC URL

To connect via a JDBC URL, provide the following connection information:

  • JDBC URL
    Example

    jdbc:google:mysql://<instance connection name>/<database>
  • Username
  • Password
Get your instance connection name

The instance connection name identifies your instance on the Google Cloud Platform. You can get it from the Cloud Platform Console, or by using the gcloud command-line tool:

gCloud SQL for MySQL instances describe [INSTANCE_NAME]

For example, for the instance myinstance1 in project myproject1, the gcloud output would be:

connectionName: myproject1:us-central1:myinstance1

Custom Query

Select the CUSTOM QUERY option to provide a SQL query instead of connecting to a single table. Data Studio uses this custom SQL as an inner select statement for each generated query to the database.

Special data types

Data Studio will map your table’s column data types to a unified set of Data Studio types. Some database types are currently not supported in Data Studio. When Data Studio encounters a column of a non-supported type, it will not create a field for that column.

Notes

  • Data Studio does not support MySQL's Spatial Data Extensions.
  • You can query a maximum of 100K rows using this connector.
  • Column headers (field names) must use ASCII characters only. Non-ASCII characters aren't supported.
Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
102097
false