How to expose a port (mysql)
-
I would like to modify a container (e.g. MySQL) to expose a port to the host.
How can I change this configuration within Cloudron to do this?
One of the reasons for this is so I can connect into MySQL remotely (local network) for development purposes.
Thanks,
-gregg
-
@chicagogregg would a solution using an SSH tunnel as described at https://forum.cloudron.io/topic/2200/external-mysql/5 also work for you?
-
@chicagogregg If you need to work with the mySQL db for a specific app this can be done via the terminal in each app. Also, you could just SSH into your server and access it that way.
-
@atridad Thanks for the reply.
I'd like to access the tcp/3306 on the mysql container directly from the local network. I need this for such command line tools such as mysqldump & mysql (for importing) commands as well as some GUI tools.
I'm assuming you're referring to ssh'g into the cloudron server and then access mysql on the mysql container (tcp/3306) via the command line... while that would work, it wouldn't allow me to access mysql directly from the local network. I wonder if I could proxy through via SSH.
Is there any way I could configure the container image to expose this port on the host itself so I can access it directly? (even if it's on a different port)
(Hmm, I wonder if I could use iptables with FORWARD?)
How can I find the MySQL root password for the cloudron host (if I ever need it?)? I found out how to get the root password for the MySQL container host (but not yet on the main cloudron host).
Thanks!
-gregg
-
@chicagogregg would a solution using an SSH tunnel as described at https://forum.cloudron.io/topic/2200/external-mysql/5 also work for you?
-
@nebulon I wound up using an SSH tunnel to connect into the MySQL server (mysql container) through the cloudron server.
I didn't know about that link you sent to me, but that's exactly what I did with the:
env | grep CLOUDRON_MYSQL_
to get the username/password.
Since I'm tunneling via SSH I don't have a need to expose the port from the cloudron server. However, if I do need to, I probably can use iptables FORWARD. I'll stay away from that in the meantime.
Thanks for the help. Let's close this thread as resolved.
Thanks,
-gregg
-
@chicagogregg By chance did you or someone write up a step by step guide on this? I'm needing to do something similar but for whatever reason, ssh proxying and I don't seem to get along.