DataLab Docs
  • What is DataLab?
  • Work
    • Creating a workbook
    • Sharing a workbook
    • Managing a workbook
    • Code cell
      • Working with packages
    • Text cell
      • Including images
    • SQL cell
      • SQL scenarios
      • Parameterize your SQL query
    • Explore Data cell
    • Chart cell
      • Configuring your chart
      • Pivot charts
      • Migration guide
    • AI Assistant
    • Version history
    • Scheduled runs
    • Hiding and showing cells
    • Long-running cells
    • Report view
    • Environment variables
    • Git and GitHub
  • Connect to Data
    • Connect your data to DataLab
    • Sharing a Data Source
    • Airtable
    • Amazon Athena
    • Amazon S3
    • Databricks
    • Dropbox
    • Files
    • Google Drive
    • Google BigQuery
    • Google Sheets
    • MariaDB
    • Microsoft SQL Server
    • MongoDB
    • MotherDuck
    • MySQL
    • Oracle Database
    • PostgreSQL
    • Redshift
    • Snowflake
    • Supabase
  • Guides
    • Publish a notebook
    • Importing data from flat files
    • Resizing plots
    • Show Bokeh and Pyvis plots
  • Resources
    • Pricing
    • Manage group settings
    • Reporting for Group Admins
    • DataLab for education
    • Technical requirements
    • Addressing slow code
    • Address R vulnerability
    • Get help
Powered by GitBook
On this page
  • Preparing to connect
  • How to connect
  • Use a sample database
  • FAQ
  • Security

Was this helpful?

  1. Connect to Data

Connect your data to DataLab

PreviousGit and GitHubNextSharing a Data Source

Last updated 3 months ago

Was this helpful?

DataLab makes querying databases and data warehouses a breeze. You can query a growing list of database technologies with DataLab's SQL cell:

  • Amazon Athena

  • Databricks

  • Files

  • Google BigQuery

  • Google Sheets

  • MariaDB

  • Microsoft SQL Server

  • MotherDuck

  • MySQL

  • Oracle Database

  • PostgreSQL

  • Redshift

  • Snowflake

For data storage solutions and technologies that are not yet natively supported through the SQL cell, you can use Environment variables in combination with Python or R to securely read and write data. Visit the dedicated documentation articles for instructions. If you'd like us to add native support or documentation for additional database technologies, !

Preparing to connect

To set up a connection between DataLab and a database, you will provide DataLab with the credentials for a user account in your database. DataLab will use these credentials to execute queries against the database. The permissions of this user account will control which tables and records you can access when querying this database.

We recommend you create (or ask your database admin to create) a new database user specifically for using with DataLab. Grant this new user read-only permission for the schemas and tables you want users to be able to query with the SQL cell.

In addition to getting the credentials, ensure your database:

  • Is accessible from the internet (see How do I know if my database is accessible on the internet?)

  • Is allowed to accept incoming connections from DataLab's IP addresses (all connections from DataLab will come from one of these three IP addresses):

    • 34.196.109.37

    • 52.202.191.84

    • 52.45.90.208

How to connect

  1. Sign in to DataLab.

  2. Click Databases in the sidebar

  3. Click Connect Database

  4. Follow the instructions to connect your database and test the connection.

Once database credentials are filled in and the database connection is set up, for security reasons the credentials can not be consulted again.

Use a sample database

Don't have a database but still want to experiment with native database connections and SQL cells? DataLab features sample databases for every natively supported database technology. You can select the sample database in the dropdown when you create a SQL cell.

FAQ

Who can see and use database connections I set up?

If you set up a database connection in your personal account, only you can use and edit this database connection. It can not be shared with other users. This means that you cannot invite other users as an editor to a personal workbook that has a database connected.

If you set up the database connection in a group that you're a part of, you can use and edit the database connection, but other members of the group can also use the database connection. It is possible to control who can use your data source within the group. See Sharing a Data Source for more information.

How do I know if my database is accessible on the internet?

A database is "publicly accessible" if the server the database is hosted on can be reached via any internet connection, not requiring users to be logged into a VPN or connected to a private network.

To check if your database is publicly accessible, run the following command on a computer that's not logged into your VPN or private network. Replace your_db_host and your_db_port with the host and port of your database:

  • Linux or OSX: nc -v your_db_host your_db_port

  • Windows: telnet your_db_host your_db_port

Security

DataLab allows you to use TLS/SSL (Transport Layer Security/Secure Socket Layer) to encrypt communication with your database. This encrypts data while it's in transit between your database and DataLab. For auditing purposes, DataLab tracks who executed which query in what workbook and when.

If your database or network environment can not be configured to meet the above requirements, ; we're happy to help!

Databases that are running on your computer (i.e. on localhost) are also not publicly accessible, unless you expose them to the internet through tools like or .

DataCamp is ISO 27001 certified. Your data is protected by solid security practices and policies. For more information, see DataCamp's and .

reach out
reach out
ngrok
Tailscale
approach to security
privacy policy