"db query error: query failed - please inspect Grafana server log for details" when connecting a mysql data source

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.

Hey @cesq ! Did you ever figure out this error? I am experiencing something very similar and cannot figure out a solution. Any information would be greatly appreciated, thank you so much!!

Hi @nickc2, sadly I didn’t figure it out. What I was trying to accomplish was strictly for cosmetic purposes so I didn’t wanna devote all my time to it as there are more important matters at my job.
Hope you figure it out though! I hit a brick wall ://

I’m in the same boat here. Especially the cosmetic purposes part.
The information i’m inputting is exactly the same as the config, and the logs are not providing any helpful insights. IF anyone manages to find a solution please let me know!