InfluxQL shell
设置 InfluxDB 连接
创建一个新的 CLI 配置
# influx config create --config-name wgs-02 --host-url http://localhost:8086 --org wgs --token 59fSTydF26m1P34QUVE3EtAUPbjETN2mX1x5aql1A-_DqDOO0wAiWnU8KgQl-cLQ88Fh6_WalQSvNzcvouqbjQ== --active
Active Name URL Org
* wgs-02 http://localhost:8086 wgs
查看 Influx CLI configs
# cat /root/.influxdbv2/configs
[default]
url = "http://localhost:8086"
token = "yxhyIIkHRyQMUBKHpMMnOBd-d6DdEr-LLUgZQd0-iNJV3xB3C44AsKjrxCKh084LS2bpl6Yfcyo1mM0BSh0V8A=="
org = "wgs"
previous = true
[wgs-02]
url = "http://localhost:8086"
token = "59fSTydF26m1P34QUVE3EtAUPbjETN2mX1x5aql1A-_DqDOO0wAiWnU8KgQl-cLQ88Fh6_WalQSvNzcvouqbjQ=="
org = "wgs"
active = true
启动 InfluxQL shell
# influx v1 shell
InfluxQL Shell 2.6.1
Connected to InfluxDB OSS v2.6.1
>
执行 InfluxQL 查询
查询databases
> show databases
参考文档
https://docs.influxdata.com/influxdb/v2.6/tools/influxql-shell/