PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, November 13, 2022

[FIXED] How to connect to MySQL with Grafana Docker to lokal MySQL Server

 November 13, 2022     docker, grafana, plesk     No comments   

Issue

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.


Solution

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



Answered By - Gon
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing