Dialects that use these instructions
MySQL, Clustrix, MariaDB, and SingleStore (formerly MemSQL) share the database setup requirements described on this page.
Encrypting network traffic
Looker strongly recommends encrypting network traffic between the Looker application and your database. Consider one of the options described on the Enabling secure database access documentation page.
If you’re interested in using SSL encryption, see this MySQL documentation page.
Users and security
To create and grant the required access to the Looker user, follow the instructions in the section appropriate to your database dialect and version:
MySQL 8.0.X:
The Looker MySQL 8.0.X dialect option is implemented with the patch version 8.0.12+ because of a MySQL deprecation in implicit sorting in the
GROUP BY
clause. This affects Looker subtotals for MySQL versions 8.0.0 through 8.0.11, causing SQL generation errors. Looker suggests upgrading any MySQL 8.0.X databases to at least 8.0.12 to fully integrate. However, earlier MySQL versions will still work, aside from subtotals.
In MySQL 8.0.X, the default authentication plugin is caching_sha2_password
. Looker uses the mysql_native_password
plugin
to attempt to authenticate to MySQL databases through the JDBC driver. For this version of MySQL to work properly,
you must take the following additional steps:
- Configure the MySQL database to use the
mysql_native_password
plugin. This can be done in multiple ways, and will depend on how your MySQL 8 database is deployed and what type of access you have to the configuration:- Start the process with the flag
--default-auth=mysql_native_password
-
Set the property in the
my.cnf
configuration file:
[mysqld] default-authentication-plugin=mysql_native_password -
If your database instance is hosted through AWS RDS, set the
default_authentication_plugin
parameter through an RDS Parameter Group that is applied to this database instance.
- Start the process with the flag
-
Issue the following statements, replacing
some_password_here
with a unique, secure password:CREATE USER looker IDENTIFIED WITH mysql_native_password BY 'some_password_here'; GRANT SELECT ON database_name.* TO 'looker'@'%';
MySQL 5.7.X and earlier, Clustrix, MariaDB, and SingleStore:
Issue the following statements, replacing some_password_here
with a unique, secure password:
Temp schema setup for persistent derived tables
These database dialects support the creation of persistent derived tables (PDTs). This feature can be very useful, and we recommend enabling it when possible.
To enable PDTs, you need to configure a temp schema. The following commands show an example of creating a temp database and granting the required privileges to the looker
user.
You can specify the name of the temp database in the Temp Database field when creating your database connection. If you don’t specify a temp database name, Looker generates a scratch database named
looker_tmp
. The following commands uselooker_tmp
, but if you specified a different temp database name, use your temp database name instead oflooker_tmp
.
For SingleStore, or if your database uses GTID-based replication, you must use the create_process
LookML parameter to use PDTs, because GTID does not support CREATE TABLE AS SELECT
statements.
Alternative setup for regular derived tables
If you do not want to allow the creation of persistent derived tables, you can still use regular derived tables. To use regular derived tables, you still need to add certain permissions to a schema called looker_tmp
. However, the looker_tmp
schema does not actually need to exist in your database!
Setting the max_allowed_packet
variable
For MySQL, set the MySQL max_allowed_packet
variable to its maximum value, 1073741824, to prevent “SQLException: Packet for query is too large” errors.
Feature support
For Looker to support some features, your database dialect must also support them.
In Looker 22.6, MySQL supports the following Looker features:
In Looker 22.6, MySQL 8.0.12+ supports the following Looker features:
In Looker 22.6, Clustrix supports the following Looker features:
In Looker 22.6, MariaDB supports the following Looker features:
In Looker 22.6, SingleStore supports the following Looker features:
In Looker 22.6, SingleStore 7+ supports the following Looker features:
Next steps
After completing the database configuration, you can connect to the database from Looker using these directions.
When creating connections, be sure to use the correct database dialect name. Although the database configuration instructions are the same for MySQL, Clustrix, MariaDB, and SingleStore be sure to pick your specific dialect from the Dialect drop-down on the Connections page, which is described next.