1

I have a docker image with mysql which has an internal port of 3307. I'm also trying to run the container for adminer, but when it starts it tries to connect to the standard port 3306, is there any variable that would indicate the port number to connect to?

1 Answers1

0

You can map the 3306 port of the host and the 3307 port of the container, so that you can connect by connecting the IP:3306 of the host. Of course, you can change the my.cnf file of the container and change the port to 3306, which can also be solved.

dogs Cute
  • 564
  • 3
  • 9
  • is there any env variable that can be passed to the container so that it changes the port settings? – Salih Pagashev Oct 12 '22 at 11:54
  • @SalihPagashev The host's environment variable is useless to the container. If your mysql database has no data, just delete it and build a container with a 3306:3307 correspondence. – dogs Cute Oct 12 '22 at 11:57