Users and security
Create a database user that can connect Cloud SQL 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;
Connecting the database
In the Admin section of Looker, select Connections, and then click Add Connection.
Fill out the connection details (see the Connecting Looker to your database documentation page for more information):
- Dialect: Google Cloud SQL.
- Host: The database hostname used to connect to the Google Cloud SQL database. For an SSH tunnel, use
localhost
. - Port: The port used to connect to the Google Cloud SQL database.
- Database: The name of the Google Cloud SQL database instance.
- Username: The username of the account Looker will use to log in to Google Cloud SQL.
- Password: The password of the account Looker will use to log in to Google Cloud SQL.
- Additional Params: Additional JDBC Parameters (optional).
SSL: If checked, enables an SSL connection; however, SSL connections to Google Cloud SQL are not supported by default.
Google Cloud SQL requires additional steps for configuring SSL connections; see Configuring SSL/TLS certificates. Google Cloud SQL creates a server certificate on the creation of each instance, so the custom certificate must be installed on the Looker server for successful SSL connections. This option is available only for customer-hosted Looker deployments that have access to the Looker server.
Because of this requirement, a better alternative to SSL is to connect Looker to Google Cloud SQL through a Cloud SQL Proxy and an SSH tunnel.Verify SSL: If checked, SSL verification is enforced. However, SSL connections to Google Cloud are not supported by default.
PDT support
Google Cloud SQL 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 23.4:
Feature | Supported? |
---|---|
Support Level | Supported |
Symmetric Aggregates | Yes |
Derived Tables | Yes |
Persistent SQL Derived Tables | Yes |
Persistent Native Derived Tables | No |
Stable Views | No |
Query Killing | Yes |
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 | Yes |
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.