Cannot Connect to MySQL DB

Hello there,

I install Grafana in a windows server and it refuse to connect to the db server which have MySQL db installed in port 3306. Grafana gives the error shown in the image.

And iam sure the connection between the two servers (grafana server and MySQL db server) is fine, i check the firewall and everything.
I dont know why it is not connecting.

Also I want to mention that i am able to connect with MS SQL server the same way, this issue happens only with MySQL db, I try three different servers that have MySQL db, non of them worked and the same error appear.

Hi @loay96azri,

Welcome to the :grafana: community support forums !!

I think you might be either missing the privileges or firewall port forwarding.

Please check this link as it list some good example to tackle such issues.

I hope this helps.


What do you have for your settings in the following section of mysql for grafanareader?

Thank you very much,
I find the solution in the link you sent.
I just needed to execute the following command in MySQL to allow the connection from the Grafana Server.

CREATE USER ‘grafana’@‘IP-Address’ IDENTIFIED BY ‘password’;
GRANT SELECT ON my2.* TO ‘grafana’@‘IP-Address’;