onto my web server I installed with Plesk a Grafana docker container. There is a MySQL database installed onto the Server too.
I started the container, and into Grafana I started with setting up a MySQL datasource.
I tried localhost:3306 as host, and I pasted the credentials. But after "Save & Test" I get the error message:
dial tcp 127.0.0.1:3306: connect: connection refused
I think I have a understanding Problem with my Host address. Is there someone who can help me?
Thanks.
You have the error because when you use 127.0.0.1, you refer the IP address of your container.
For example: On Windows, your Docker (if you use Docker Toolbox) have the IP address 192.168.99.100 and your PC have the IP address 192.168.99.1
So if you host your MySQL DB on your local machine, the database host is 192.168.99.1 and your connection must refer 192.168.99.1:3306