How to connect grafana to influxdbv2 by InfluxQL method

Hi everyone,
First, sorry about my english
I have just installed Grafana v7.3.6 and Influxdb v2.0.3
I am trying connect data source on grafana to influxdb server by InfluxQL method but it giving error bad request.
I already followed this page but it can’t be work!

I know I can connect by Flux method (I tried and success) but i want to InfluxQL method
Please help me if you have same error. Thanks everybody.

1 Like

As I understand it, you cannot connect Grafana 7 with Influx 2.0 OSS using influxql. Only Flux. Which has caused me to start a crash course on Flux in the past week.

There are other versions of Influx that do work. I believe you have to map a database to a bucket, inside of InfluxDB.

HI @Brian_Gibson
I mapped bucket to database but still not work

@Brian_Gibson,
I map unmapped bucket as Query data with InfluxQL | InfluxDB OSS 2.0 Documentation

Are you using Influx 2.0 OSS?

Anyone got it working ?
I am also using grafana 7.3.6 with influxdb 2.0.3 and I have the same problem.
Even following the link: Creating InfluxQL Datasource to InfluxDB v2 returns Unauthorized(401) or InfluxDB Error: Bad Request · Issue #29372 · grafana/grafana · GitHub I am not able to understand what the mean with "This should contain the value: “Token {token}”
thanks

1 Like

Yes, I’m using influxdb v2.0.3

Hi, as i am a newbie on this can you help me with the steps needed to put it working ?
I have installed the influxdb v2.0.3 and created an Organization and a Bucket, how should I map unmapped bucket, is there any rule to name the database or can it be anything ?
I dis also installed Grafana 7.3.6, How did you configure the data source, where did you configure the token ?
thanks in advance, if would be great if you could help me.

Hi,
If you choose Flux method, configure like this

1 Like

Hi, thanks for your answer, using Flux I am able to connect, what I am not able to do is to connect with InfluxQL. were you able to make it work ?
thanks again.

Sorry for my English.
Yesterday I spent half a day with this. Unfortunately, the documentation on this is poor.
We have to get information piece by piece. Here’s my experience.
1.Match is required as specified here https://docs.influxdata.com/influxdb/v2.0/query-data/influxql/#map-unmapped-buckets
2. create a source https://docs.influxdata.com/influxdb/v2.0/tools/grafana/
In addition, what is in this manual must be added according to this instruction -
https://github.com/grafana/grafana/issues/29372#issuecomment-733717988
Please note, the token is in the format - Token mytoken. That is, before the token itself, write the word - Token
Good luck

1 Like

Hi, my english is not good also,
Anyway, thanks for your help, but I would like to ask you if the database and retention policy that must be created, document of point 1:

influx v1 dbrp create
–db example-db
–rp example-rp \

needs to be something special or just a name that you decide to use, the same for retention policy.

Regards, thanks again.

Hi, Unfortunately that is my issue too.

Hi,
Like you said, it’s work for me i can connect from grafana to influxdbv2.0.3 by influxQL method.
Here is my configure data source on grafana
image



But in the end I can not query to database of influxdbv2.0.3 with error
image
Datasource is fine but cannot query to it ?. Can you help me ? many tks

When I change database to name of database instead of 7d6d9c07e47e2257 it’s work totaly. There is no more error not excuted from influxdb

Here is my complete code for creating the mapping -

influx v1 dbrp create \
–db mydb \
–rp autogen \
–bucket-id 123456789 \
–default \
–org myorg \
–token mytoken

mydb - the database to which I create a connection in Grafana
autogen - retention policy. To be honest, I set this parameter intuitively.
123456789 - is the ID of the mydb database specified above. It can be found in the interface, item “Data - Buckets”
myorg - organization name
token - token

Thank you very much for your help, I have it running now.

I’m using cloud so how do I connect? What url should I enter that it understand the connection path?
Thanks for the help

Hello everyone,
I dare to ask for a summary ? I can’t do it.

You have to add the Influx token in “Custom HTTP Headers” but what’s this “user” thing? It’s a notion that isn’t really there anymore with InfluxDB 2, isn’t it ?

And you have to use the bucket ID ? really ?

Thanks,

@JBrdy Are you trying to connect Grafana and Influx Cloud?