Db query error: failed to connect to server - please inspect Grafana server log for details MYSQL

  • What Grafana version and what operating system are you using?
    Grafana Cloud

  • What are you trying to achieve?
    I am trying to generate a connection from a mysql database from an azure server to Grafana Cloud

  • How are you trying to achieve it?
    Adding the credentials and verifying that they are correct.

  • What happened?
    I get the message: db query error: failed to connect to server - please inspect Grafana server log for details

  • What did you expect to happen?
    That the connection to my database is generated correctly

  • Can you copy/paste the configuration(s) that you are having problems with?
    For the security of my server I prefer not to do it

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    failed to connect to server - please inspect Grafana server log for details

  • Did you follow any online instructions? If so, what is the URL?
    I am not following any instructions online

Welcome,

Is the mysql user you are using properly configured in mysql? Is it configured to accept the credential from all hosts via % (less safe) or the specific grafana host ip address (more safe)

how can i access grafana server settings in grafana cloud for more details? It’s kind of tedious not getting the exact connection error and having to resort to a CLI should improve that. As for the host credential permissions how could I check it? Is this permission setting done from Grafana or from my server? It’s not very clear to me

Where is your db server located at?

In the Azure cloud. This is my hostname: innahealthbsc.mysql.database.azure.com

In that host, have you configured which user from which host can connect to it?

This is more mysql security than a grafana issue

I think I already found the solution. In my Azure configuration I have to add the “firewall rule name” with the grafana Cloud IP address, just as I have it configured with the IP of my current machine. I have searched and I have not found information similar to a specific IP address with which I can generate the connection. Could you help me with this?

1 Like

No, I have added the Starting IP Address 0.0.0.0 and Ending IP Address
255.255.255.255 to allow connection from anywhere, and still get the same error when trying to generate the connection in Grafana. What is causing this problem?

Hi @innhpractica,

Just wanted to update that I have moved this post from MySQL to Grafana Cloud Category as this seems more related to your question.

Did you able to find a solution or is still having the problem?

Are you using the Free cloud version of Grafana?