首页 > 解决方案 > 在 influxdb 中创建用户表

问题描述

我正在尝试在 influxdb 中创建一个包含用户名和密码的简单表。但是我无法这样做,因为创建表始终需要标签。我想创建一个以用户名和密码作为字段键的表。我写的查询是:

insert users,password value=password,admin value=admin

Error: missing tag value

请帮忙。提前致谢。

标签: influxdb

解决方案


标签是可选的。

您的查询应该是:

insert tablename password="yourpasswordvalue",user="yourusername"

由线路协议https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_tutorial/指定

验证

> select * from tablename
name: tablename
time                password          user
----                --------          ----
1552757801383612800 yourpasswordvalue yourusername

推荐阅读