Grafana cannot connect to InfluxDB

Hello, i am sorry, can you help me please.
I have read a lot but can not find a solution…

  • What Grafana version and what operating system are you using?
    operating system = Ubuntu 18.04
    GRAFANA_VERSION=8.0.1 in docker-container
    INFLUXDB_VERSION=2.0.7 in docker-container

  • What are you trying to achieve?
    I am trying to connect Grafana to InfluxDB

  • How are you trying to achieve it?

  1. Checked InfluxDB settings:
  • 1 user = admin, passw 12345678
  • 1 bucket = my-bucket
  • 1 token = my-secret-token
  1. i have read this instruction
    Use Grafana with InfluxDB OSS | InfluxDB OSS 2.0 Documentation
    tried to set
    Data Sources / InfluxDB
    influxQL
    URL = http://192.168.181.128:8086
    Custom HTTP Headers:
    Header = Authorization
    Value = my-secret-token
    Database = my-bucket
    user = admin
    password = 12345678
    HTTP Method = get

also i tried to ping from docker with grafana 192.168.181.128. Ping ok.
and netcat 192.168.181.128:8086. NC ok.

  • What happened?
    InfluxDB Error: Bad Request

  • What did you expect to happen?
    Grafana is connected to InfluxDB

Have you checked that you can connect and authenticate to Influx using the
above credentials from the influx command line interface, quite independently
of Grafana?

https://docs.influxdata.com/influxdb/v2.0/reference/cli/influx/

Antony.

Can you please help and explain what command i must enter to check my connection to influx?

When i in influx-container tried this
influx auth list -u admin -t “my-secret-token” this worked.

07ab09e1976e4000 admin’s Token my-secret-token admin 07ab09e1826e4000 [read:authorizations write:authorizations read:buckets write:buckets read:dashboards write:dashboards read:orgs write:orgs read:sources write:sources read:tasks write:tasks read:telegrafs write:telegrafs read:users write:users read:variables write:variables read:scrapers write:scrapers read:secrets write:secrets read:labels write:labels read:views write:views read:documents write:documents read:notificationRules write:notificationRules read:notificationEndpoints write:notificationEndpoints read:checks write:checks read:dbrp write:dbrp]

When i returned to my main system this command is not working also in grafana
influx: command not found

Also i tried in main system:
http://localhost:8086/query?Authorization=my-secret-token&u=admin&password=12345678
i have json answer
|code|unauthorized|
|message|unauthorized access|

and tried this in main:
curl -G ‘http://localhost:8086/query?pretty=true’ --data-urlencode “db=my-bucket” --data-urlencode “q=SELECT “value” FROM “cpu_load_short” WHERE “region”=‘us-west’;SELECT count(“value”) FROM “cpu_load_short” WHERE “region”=‘us-west’” -u admin -t “my-secret-token”
first it asks question: Enter host password for user ‘admin’:
i entering 12345678
answer: {“code”:“unauthorized”,“message”:“Unauthorized”}

Flux query accepted InFluxQL not

InfluxQL supported only in InfluxDB 1.x
2.x only Flux

that is why i cannot connect to InfluxDB by InfluxQL