我正在尝试使用influxdb-ruby
gem连接到Influxdb。
使用:
influx -username admin -password secret
> SHOW DATABASES;
name: databases
---------------
name
_internal
metrics
工作正常。
但是如果我尝试使用Ruby:
client = InfluxDB::Client.new(host: "host", port: 8086, database: "metrics", user:"admin", password: "secret")
client.list_databases
InfluxDB::AuthenticationError: {"error":"authorization failed"}
这里有什么提示吗?
提前致谢
答案 0 :(得分:0)
您必须将user
参数替换为username
。
client = InfluxDB::Client.new(host: "host", port: 8086, database: "metrics", username:"admin", password: "secret")