linux下influx客户端使用
influxdb-client
通过
sudo apt-cache search influx
找到了一个客户端工具
influxdb-client - command line interface for InfluxDB
直接安装
sudo apt install influxdb-client
influx
Connected to http://localhost:8086 version v2.2.0
InfluxDB shell version: 1.6.7~rc0
> help
Usage:
connect <host:port> connects to another node specified by host:port
auth prompts for username and password
pretty toggles pretty print for the json format
chunked turns on chunked responses from server
chunk size <size> sets the size of the chunked responses. Set to 0 to reset to the default chunked size
use <db_name> sets current database
format <format> specifies the format of the server responses: json, csv, or column
precision <format> specifies the format of the timestamp: rfc3339, h, m, s, ms, u or ns
consistency <level> sets write consistency level: any, one, quorum, or all
history displays command history
settings outputs the current settings for the shell
clear clears settings such as database or retention policy. run 'clear' for help
exit/quit/ctrl+d quits the influx shell
show databases show database names
show series show series information
show measurements show measurement information
show tag keys show tag key information
show field keys show field key information
A full list of influxql commands can be found at:
https://docs.influxdata.com/influxdb/latest/query_language/spec/
> connect 192.168.0.5:8086
> auth
username: admin
password:
> show databases
name: databases
name
----
mydata
_internal
graphite
> use mydata
Using database mydata
> select time,a0 from data_tt limit 10
name: data_tt
time a0
---- --
0 -0.91
0 -0.91
0 -0.91
0 -1.24
0 -1.24
0 -1.25
0 -1.35
0 -1.35
0 -1.35
0 -1.38
还有一种方法就是在浏览器其直接访问:
http://192.168.0.5:8086/query?db=mydata&q=select a0 from data_tt limit 10
在浏览器内会提示输入用户名称和密码,就可以显示查询到的数据
{"results":[{"statement_id":0,"series":[{"name":"data_tt","columns":["time","a0"],"values":[["1970-01-01T00:00:00Z","-0.91"],["1970-01-01T00:00:00Z","-0.91"],["1970-01-01T00:00:00Z","-0.91"],["1970-01-01T00:00:00Z","-1.24"],["1970-01-01T00:00:00Z","-1.24"],["1970-01-01T00:00:00Z","-1.25"],["1970-01-01T00:00:00Z","-1.35"],["1970-01-01T00:00:00Z","-1.35"],["1970-01-01T00:00:00Z","-1.35"],["1970-01-01T00:00:00Z","-1.38"]]}]}]}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)