我在InfluxDB中遇到设置身份验证的麻烦。首先,以下教程告诉我更改配置文件:
[http]
enabled = true
bind-address = ":8086"
auth-enabled = true # ✨
log-enabled = true
write-tracing = false
pprof-enabled = false
https-enabled = false
https-certificate = "/etc/ssl/influxdb.pem"
但是当我更改时,重新加载服务器。我无法创建用户。
CREATE USER paul WITH PASSWORD 'timeseries4days' WITH ALL PRIVILEGES
ERR: unable to parse Basic Auth credentials
Warning: It is possible this error is due to not setting a database.
Please set a database with the command "use <database>".
因此,当使用我创建的数据库时:
USE example
ERR: unable to parse Basic Auth credentials
现在,我不知道我该怎么做才能将身份验证设置为仅向用户(在此情况下为paul)授予读取和写入数据库example
的权限。
答案 0 :(得分:1)
现在Authentication
是enabled
,您需要先对自己进行身份验证,然后才能在数据库中执行任何操作。
错误unable to parse Basic Auth credentials
表示您未传递任何凭据。
如果您尝试使用influx
二进制文件创建用户,则必须设置-username
和-password
选项。
例如:
influx -username "my_username" -password "my_password" \
-execute "CREATE USER parul WITH PASSWORD 'timeseries4days'