一、InfluxDB操作方式
InfluxDB提供三种操作方式:
1)客户端命令行方式
2)HTTP API接口
3)各语言API库
二、InfluxDB数据库操作
如同MYSQL一样,InfluxDB提供多数据库支持,对数据库的操作也与MYSQL相同。
0)进入influxDB,输入命令:
influx
或
InfluxDB HTTP API8086默认在端口上运行。因此,influx将连接到端口8086和localhost默认。如果您需要更改这些默认值,请运行influx --help。
该-precision参数指定任何返回的时间戳的格式/精度。在上面的示例中,rfc3339告诉InfluxDB以RFC3339格式(YYYY-MM-DDTHH:MM:SS.nnnnnnnnnZ)返回时间戳。
$ influx -precision rfc3339
Connected to http://localhost:8086 version 1.4.x
InfluxDB shell 1.4.x
>
1)显示数据库:
>show databases
name: databases---------------name
telegraf
_internal
lir
testDB
testMyDb
2)新建数据库:
>create database test>show databases
name: databases---------------name
telegra