Google Cloud SQL for MySQL

Encrypting network traffic

It is a best practice to encrypt network traffic between the Looker application and your database. Consider one of the options described on the Enabling secure database access documentation page.

Users and security

Create a database user that can connect Google Cloud SQL for MySQL to Looker. In the following commands, change some_password_here to a unique, secure password, and grant SELECT privileges to the database you want Looker to query:

CREATE USER looker;
SET PASSWORD FOR looker = PASSWORD ('some_password_here');
GRANT SELECT ON database_name.* TO looker;

Creating the Looker connection to your database

In the Admin section of Looker, select Connections, and then click Add Connection.

Fill out the connection details. The majority of the settings are common to most database dialects. See the Connecting Looker to your database documentation page for information. Some of the settings are described next:

  • Dialect: Google Cloud SQL.
  • Host: The database hostname used to connect to the Google Cloud SQL for MySQL database. For an SSH tunnel, use localhost.
  • Port: The port used to connect to the Google Cloud SQL for MySQL database.
  • Database: The name of the Google Cloud SQL for MySQL database instance.
  • Username: The username of the account Looker will use to log in to Google Cloud SQL for MySQL.
  • Password: The password of the account Looker will use to log in to Google Cloud SQL for MySQL.
  • Additional JDBC parameters: Additional JDBC parameters (optional).
  • SSL: If checked, enables an SSL connection; however, SSL connections to Google Cloud SQL for MySQL are not supported by default.

  • Verify SSL: If checked, SSL verification is enforced. However, SSL connections to Google Cloud are not supported by default.

To verify that the connection is successful, click Test. See the Testing database connectivity documentation page for troubleshooting information.

To save these settings, click Connect.

PDT support

Google Cloud SQL for MySQL does not support CREATE TABLE AS SELECT statements, so you must use the create_process LookML parameter to define PDTs.

Feature support

For Looker to support some features, your database dialect must also support them.

Google Cloud SQL supports the following features as of Looker 24.6:

Feature Supported?
Support Level
Supported
Looker (Google Cloud core)
Yes
Symmetric Aggregates
Yes
Derived Tables
Yes
Persistent SQL Derived Tables
Yes
Persistent Native Derived Tables
No
Stable Views
No
Query Killing
Yes
SQL-based Pivots
Yes
Timezones
Yes
SSL
Yes
Subtotals
Yes
JDBC Additional Params
Yes
Case Sensitive
No
Location Type
Yes
List Type
Yes
Percentile
Yes
Distinct Percentile
Yes
SQL Runner Show Processes
Yes
SQL Runner Describe Table
Yes
SQL Runner Show Indexes
Yes
SQL Runner Select 10
Yes
SQL Runner Count
Yes
SQL Explain
Yes
Oauth Credentials
No
Context Comments
Yes
Connection Pooling
No
HLL Sketches
No
Aggregate Awareness
No
Incremental PDTs
No
Milliseconds
Yes
Microseconds
Yes
Materialized Views
No
Approximate Count Distinct
No

Next steps

After you have created your database connection, set authentication options.