Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved How to expose a port (mysql)

    Support
    4
    6
    179
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      ChicagoGregg last edited by

      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

      atridad 1 Reply Last reply Reply Quote 0
      • nebulon
        nebulon Staff @ChicagoGregg last edited by

        @chicagogregg would a solution using an SSH tunnel as described at https://forum.cloudron.io/topic/2200/external-mysql/5 also work for you?

        C 1 Reply Last reply Reply Quote 1
        • atridad
          atridad App Dev @ChicagoGregg last edited by

          @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.

          I type things and sometimes those things end up in your browser. 🏳️‍🌈🇮🇷🇨🇦

          C 1 Reply Last reply Reply Quote 0
          • C
            ChicagoGregg @atridad last edited by ChicagoGregg

            @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

            nebulon 1 Reply Last reply Reply Quote 0
            • nebulon
              nebulon Staff @ChicagoGregg last edited by

              @chicagogregg would a solution using an SSH tunnel as described at https://forum.cloudron.io/topic/2200/external-mysql/5 also work for you?

              C 1 Reply Last reply Reply Quote 1
              • C
                ChicagoGregg @nebulon last edited by

                @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

                doodlemania2 1 Reply Last reply Reply Quote 0
                • doodlemania2
                  doodlemania2 App Dev @ChicagoGregg last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB