Connecting to ClickHouse with ClickHouse Client
In this example we will be using the ClickHouse client maintained by the ClickHouse team. Before you begin, it is imperative to review the general steps and considerations for connecting to a ClickHouse cluster as outlined in Connecting to a ClickHouse Cluster.
1. Install clickhouse-client using the command below:
1 |
curl https://clickhouse.com/ | sh |
2. Connect to the cluster using the CLI command below. You can find the host domain name and the password for the icclickhouse user on the Connection Info page on the console:
1 |
./clickhouse client \ --host <host-of-a-node> \ --port 9440 \ --secure \ --user icclickhouse \ --password '<icclickhouse-user-password>' |
Once you are connected to the cluster, you could run queries using the CLI interface, for example:
1 |
SHOW CLUSTERS; |