I am using the docker nextcloud-docker-dev to learn about nextcloud and am trying to connect to the database to watch changes I am testing. However, I am not sure what IP address to use to connect to the database.
I am using docker desktop on Linux and for the database container it has a port of 8212:3306 and links to http://127.0.0.1:8212/ that give me a bunch of gibberish in the browser.
Any ideas of what ip address and port I could use to connect to the database?
The direct answer ist: Use port 8212 in that case. The SQL server listens on one port by default 3306. This is where the client connects by default. For whatever reason, your setup has 8212 configured as routed port. So if you connect on 127.0.0.1:8212 on your host this gets (by docker) redirected to the container port 3306.
However, there is a script in the scripts folder that allows you to dig into the DB directly. This might be more convenient as you have to think less about stuff.
Thank you christianlupus. After using the correct port I was able to connect without any issues.
I looked at the script but I am not sure how to use it. It would be nice if there was some examples some place. It says to pass in MySQL Params. Not sure what that is.
I am not sure how to start phpmyadmin. I am use to using compose files and starting and stopping from the command line but in this project I installed docker.desktop.
I changed the docker compose file and added phpmyadmin as a dependency of nextcloud but stopping and starting in docker.desktop did not pull in this change or I did not do it correctly.
There should be no need to add anything, please remove the depends line for now.
You need to start the container, so inside the nextcloud-docker-dev directory so „docker compose up -d phpmyadmin“. Then the container should be visible in desktop as well.
Ensure that you setup the hosts (there’s also a script for that in scripts/). Then connect via https://phpmyadmin.local (or http if you did not setup https)
Well, if you execute it without any further parameters, it should log you into the DB server in an interactive console. If you wanted to add parameters to the command in the container, you could add them on the CLI while invoking it.