---
title: "Save and test the connection | Grafana Labs"
description: "Save the data source, test the connection, and recognize the most common connection errors."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Save and test the connection

With the connection details entered, save the data source and confirm Grafana can reach ClickHouse.

To test the connection, complete the following step.

1. Click **Save &amp; test**.
   
   When the test succeeds, you’ll see the message `Data source is working`. This confirms Grafana can reach ClickHouse and that the credentials are valid.

You’ve saved the data source and confirmed Grafana can reach ClickHouse.

**If the test fails**

The plugin prefixes each error with a category in square brackets so you can pinpoint the problem quickly:

- `[config]` – a connection setting is missing or invalid, such as an empty host, an out-of-range port, or malformed JSON. Recheck the **Server address** and **Server port**.
- `[auth]` – the credentials or privileges are wrong. Re-check the username and password for your read-only user.
- `[network]` – Grafana can’t reach ClickHouse. Confirm the host, port, and that any firewall allows Grafana Cloud.
- `[tls]` – a TLS or certificate problem. Check that **Secure Connection** and the port match your server.

If the test reports `failed to create ClickHouse client`, clear the **Default database** field and try again – a database name that doesn’t exist is a common cause, especially on ClickHouse Cloud.

If the test passes but queries later fail with `Cannot modify 'max_execution_time': Setting is locked`, revisit the read-only user’s settings profile from the earlier milestone.

In the next milestone, you’ll verify your data by running a query in Explore.

* * *

### Troubleshooting

Explore the following troubleshooting topics if you need help:

- [Failed to create ClickHouse client](/docs/plugins/grafana-clickhouse-datasource/latest/troubleshooting/#failed-to-create-clickhouse-client)
- [Setting is locked (readonly)](/docs/plugins/grafana-clickhouse-datasource/latest/troubleshooting/#setting-is-locked-readonly)
- [Full troubleshooting guide](/docs/plugins/grafana-clickhouse-datasource/latest/troubleshooting/)
