Using Grafana v8.5.3 (409e9bc9a5)
Centos 8, kernel 4.18
I’ve been trying to add a MySQL database as a datasource to grafana but when clicking “Save & test” I get the following error:
“db query error: query failed - please inspect Grafana server log for details”
I’ve inspected the logs and here’s what I found:
lvl=eror msg="query error" err="Error 1044: Access denied for user 'root'@'%' to database 'my_database'"
However with the same credentials I am able to login via command line so I wonder why it’s an auth error.
It should be noted that the database that I am trying to add is on a different host - not on the same as the Grafana server. However I have checked that they are both able to communicate with themselves on the required port - 3306. I checked using telnet and netcat.
Here’s my configuration:
I’ve tried enabling/disabling all of the options concerning auth - Skip TLS Verify etc. All possible combinations.
I’ve also checked and made sure that this user has adequate privs to the database I’m trying to access, It should be mentioned that using this exact way, I have been able to connect to this database using MySQL Workbench (Windows) as well as using the command line, so I am completely out of ideas. Grafana is the only place where I haven’t been able to access this data source. I’ve checked firewalls and everything there is to it. Truly, a bizzare scenario. Tried researching it, visited some forums but to no avail, I am considering taking it to Chat GPT but I’m not sure if it could assist me. I am asking for your help.