influxdata-docker
influxdata-docker copied to clipboard
ERR: authorization failed for non-admin user
I'm getting "ERR: authorization failed" when executing USE
admin user
influx -host influx.example.com -username admin -password admin
Connected to http://influx.example.com:8086 version 1.5.4
InfluxDB shell version: v1.7.2
Enter an InfluxQL query
> show databases;
name: databases
name
----
telegraf
_internal
> SHOW USERS
user admin
---- -----
admin true
telegraf false
> SHOW GRANTS FOR telegraf
database privilege
-------- ---------
telegraf ALL PRIVILEGES
> GRANT ALL ON "telegraf" TO "telegraf"
> SHOW GRANTS FOR telegraf
database privilege
-------- ---------
telegraf ALL PRIVILEGES
> exit
non-admin user
influx -host influx.example.com -username telegraf -password telegraf
Connected to http://influx.example.com:8086 version 1.5.4
InfluxDB shell version: v1.7.2
Enter an InfluxQL query
> use telegraf
WARN: authorization failed
Using database telegraf
> SHOW MEASUREMENTS
ERR: authorization failed
Do you solved your problem ?
You need to use '
, like influx -host influx.example.com -username 'admin' -password 'admin'
I have this exact issue and I have not been able to resolve it by placing single quotes around the username or password. Has anyone else been able to make progress in resolving this?
Using the same credentials, I am able to write to the database using the HTTP API, but when I connect using the cli via a docker container with the credentials I experience the same behaviour as the original poster.
Any further ideas - this one is driving me mad. Thanks.
Stumbled across this thread. I found the solution I think. Posting here in case it helps others with the "Authorization failed" message.
It appears as if passing credentials with -username
and -password
might only work for admin users.
For normal users, instead use the auth
command at the influx pronpt:
# influx
Connected to http://xxx...
InfluxDB shell version: 1.8.9
> auth
username: <user>
password: <password>
> show databases