Salih Pagashev
Salih Pagashev

Reputation: 19

how to change mysql connection port in docker adminer settings

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?

Upvotes: 1

Views: 2247

Answers (3)

user3698243
user3698243

Reputation: 101

You can set the environment variable ADMINER_DEFAULT_SERVER to host:port. So if the host is db: ADMINER_DEFAULT_SERVER=db:3307

Upvotes: 0

Philippe Gonzaga
Philippe Gonzaga

Reputation: 303

On adminer login page, add the port along with the IP/servername, like this: my.server.name:3307. In your case, I believe it would be: docker_container:3307.

enter image description here

It worked here :)

Upvotes: 0

RP.S
RP.S

Reputation: 773

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.

Upvotes: 0

Related Questions