InfluxDB基本操作

influxdb

[root@JKM-MYSQL-179 HM_APPAPI]# influx 
Connected to http://localhost:8086 version 1.2.4
InfluxDB shell version: 1.2.4
> show databases ##### 查看数据库
name: databases
name
----
_internal
collectdb
telegraf
HM_APPAPI


> SHOW RETENTION POLICIES ON HM_APPAPI ##### 查看保存策略
name duration shardGroupDuration replicaN default
---- -------- ------------------ -------- -------
5d 120h0m0s 24h0m0s 1 true

> DROP RETENTION POLICY "7d" ON HM_APPAPI ##### 删除此策略


> use HM_APPAPI ##### 切换数据库
Using database HM_APPAPI

> 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
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/

 
原文地址:https://www.cnblogs.com/hyming011/p/8251658.html