General steps for creating a connection
The exact steps you need to take depend on the database dialect you are using and the other choices you make. This page serves as an outline of the steps you need to take to create a connection, with links to the details you need. You can also see this information by watching this video.
The steps are:
From your database administrator, get the contact details for your database such as hostname, database or schema name, username, and password.
Enable secure access to your database. There are two ways to do this:
- Using an IP address allowlist, optionally adding SSL encryption.
- Using an SSH tunnel, which provides an encrypted connection and extra authentication. This is more secure but also is more time-consuming to set up.
On your database, set it up to work with Looker. The instructions vary quite a bit from dialect to dialect. Typically the steps include adding permissions for Looker to access the database and possibly creating a scratch schema for Looker to create derived tables in the database. To see the instructions you need, go to the Looker dialects documentation page and click on your database dialect.
In Looker, go to the Admin panel’s Connection page. If you are in a trial, typically you won’t have any connections on that page.
Click New Database Connection to start setting up the connection to the database. You can see explanations for each field on the New Connection page in the Connections settings section of the Connecting Looker to your database documentation page. In general, you specify:
- The name you want to use to refer to the connection
- The database dialect
- The connection information for reaching your database
- Various options, including whether you’ll let Looker write derived tables to the database and how you want the connection to behave
- What time zone the database data is stored in
- Additional JDBC connection string parameters, if needed by your database
At the bottom of the New Connections page, click Test These Settings to verify the settings for Looker to reach the database. If any of the tests do not pass, try some of the troubleshooting steps on the Testing database connectivity documentation page. If you are still having trouble, doublecheck the database details with your database administrator, then contact your Looker analyst or the Looker chat team for assistance.
When the testing is successful, click Add Connection. The connection now appears on the Admin panel’s Connection page. If you are in a trial, this will be your first connection on that page.
Next, it is a good practice to doublecheck that your connection is working properly. In Looker, use the Develop menu to go to SQL Runner, which lets you use a connection to do a variety of tasks such as directly typing and running SQL queries.
In SQL Runner, select the name of the connection you created and the database or schema that you specified for the connection. Then check that the expected tables are listed. Clicking a table will show the columns in that table, verifying that Looker was able to use the connection to access your database tables.
You have now set up the database connection and verified that Looker can reach the database.
Next steps
If you are in a trial, your Looker analyst typically will have performed the other project setup steps for you. If you have time before your trial kickoff meeting, consider reading through the Development Process tutorials, which begin with the Getting started developing in Looker documentation page, or register for our LookML Developer learning journey on Looker Connect.
If you are not in a trial, the next steps for creating a new project are:
- Creating a project to hold your data model
- Configuring the project to accept your connection
- Setting up and testing Git to manage changes to the data model
Then you are ready to start writing LookML and deploying your changes to production for your business users to do adhoc queries and create dashboards.