Connecting to a New Database
This is the first step of creating your own report with the Reporting module.
We assume you already have a database configured and can connect to it from the instance on which you’re running Superset. If you’re just testing Superset and want to explore sample data, you can load some sample PostgreSQL datasets into a fresh DB or configure the example weather data we use here.
To connect to a database:
- Under the Sources menu, select the Databases option.
![Document image Document image](https://images.archbee.com/g9cApVza9NIhSh0pjZYtA/PEA4M7xxQSQzWdGUFj3Nl_image.png?format=webp)
- On the resulting page, click on the green plus + sign near the top right.
![Document image Document image](https://images.archbee.com/g9cApVza9NIhSh0pjZYtA/Uj1ZrulQBtjKNsmz7QkHU_image.png?format=webp)
- You can configure several advanced options on this page, but for this walkthrough, you’ll only need to do two things:
Name your database connection.
![Document image Document image](https://images.archbee.com/g9cApVza9NIhSh0pjZYtA/vn48XEaRhhBNRkuz6YVWV_image.png?format=webp)
Provide the SQLAlchemy Connection URI and test the connection.
![Document image Document image](https://images.archbee.com/g9cApVza9NIhSh0pjZYtA/mJzO1JZADw7Kf3wfpTnaQ_image.png?format=webp)
The example URI in the figure above is the connection string for our test weather database. As noted in the text below the URI field, you should refer to the SQLAlchemy documentation on creating new connection URIs for your target database.
- Click the Test Connection button to confirm things work end to end. Once Superset can successfully connect and authenticate, you should see a popup like this:
![Document image Document image](https://images.archbee.com/g9cApVza9NIhSh0pjZYtA/GFjJiTWUmeUzYn737bupF_image.png?format=webp)
Moreover, you should also see the list of tables Superset can read from the schema you’re connected to at the bottom of the page:
![Document image Document image](https://images.archbee.com/g9cApVza9NIhSh0pjZYtA/9hXH0141o_yEHX-zIQRSP_image.png?format=webp)
- If the connection looks good, save the configuration by clicking the Save button at the bottom of the page.
![Document image Document image](https://images.archbee.com/g9cApVza9NIhSh0pjZYtA/SlGQ6VJQpEvY6Rnunbwo6_image.png?format=webp)