---
title: Set Up the Influx Client for InfluxQL Queries
slug: bhdo/set-up-the-influx-client-for-influxql-queries
createdAt: 2022-12-06T18:38:28.000Z
---

You can set up the Influx client to execute influxQL queries.

# Before You Begin

Make sure you do the following:

- Add a database user. See [Add Database Users](https://public-docs.litmus.io/bhdo/add-database-users) for details.&#x20;
- Pull the Influxdb application image into Belden Horizon Data Operations. See [Upload an Image](https://public-docs.litmus.io/bhdo/upload-an-image) for details.&#x20;
- Launch a container using the Docker Run command. See [Manage Containers](https://public-docs.litmus.io/bhdo/manage-containers#run-a-container)  for details.&#x20;

# Step 1: Deploy Influx Container

**To deploy the Influx container:&#x20;**

1. In Belden Horizon Data Operations, navigate to **Applications&#x20;**> **Containers**.&#x20;
   The *Containers&#x20;*&#x70;ane appears.&#x20;
2. Click **Run**.&#x20;
   The *Enter command to run* field appears.&#x20;
3. Enter the following:&#x20;

:::BlockQuote
docker run -d --name influxdb influxdb
:::

The named container appears in the *Containers&#x20;*&#x70;ane and displays a running state. The container runs locally.

# Step 2: Provide Database User Access to Influx Database

**To provide database user access to Influx database:**

1. In Belden Horizon Data Operations, navigate to **Applications&#x20;**> **Containers**.&#x20;
   The *Containers&#x20;*&#x70;ane appears.&#x20;
2. Click the **Terminal&#x20;**&#x69;con next to the Influx container.&#x20;
   Th&#x65;*&#x20;Influxdb Terminal&#x20;*&#x70;ane appears.
3. Enter **influx -host 'host-IP' -port '8086' -database 'tsdata' -username 'your-username' -password 'your-password'** and press ENTER. The *host-IP* parameter is the Belden Horizon Data Operations URL IP address.&#x20;
   For example: `influx -host '192.168.7.236' -port '8086' -database 'tsdata' -username 'jsmith' -password 'jsmithpwd'`

# Step 3: Enter and Execute InfluxQL Queries

After completing step 2, you can enter and execute InfluxQL Queries.

## Example 1: Show Measurements

```none
> use tsdata
Using database tsdata
>
>
> show measurements
name: measurements
name
----
PLC1.A29A572B-A69F-4BA2-8AA5-AA842832E2D0
PowerMeter.A29A572B-A69F-4BA2-8AA5-AA842832E2D0
simulator.E12E832D-33F9-4E8F-A52B-CAE93607DE3D
>
```

## Example 2: Show Tag Keys

```none
>
>show tag keys on tsdaya
name: PLC1.A29A572B-A69F-4BA2-8AA5-AA842832E2D0
tagKey
------
datatype
device_id
register_id
tag
topic

name: PowerMeter.A29A572B-A69F-4BA2-8AA5-AA842832E2D0
tagKey
------
datatype
device_id
register_id
tag
topic

name: simulator.E12E832D-33F9-4E8F-A52B-CAE93607DE3D
tagKey
------
datatype
device_id
register_id
tag_topic
```

