No announcement yet.

[OT] Access MariaDB from outside

  • Filter
  • Time
  • Show
Clear All
new posts

  • [OT] Access MariaDB from outside

    Hi all,

    Here an offtopic, because I tried all and I'm going crazy.

    I have a server with a MariaDB instance. I have 3306 opened on my router.
    I want to connect with DBeaver (or any other Database manager) from my home to my server (located on my office).

    * I have redirected one port to local 3306
    * It's suppose I have applied the iptables rules
    * I have commented bind-address and skip-network (or something like this) in my.cnf

    What the hell more I need to do?

    Professional Scriptcase Services
    Some Customers opinions

  • #2
    have you tried using a telnet to check the connection can be made?


    • #3
      Try to set up putty. Then you have a direct channel and that has always worked well for me. (At least for MySQL).
      Albert Drent
      aducom software netherlands
      scriptcase partner, reseller, support and (turn-key) development /


      • #4
        If the server is Linux you can use an ssh tunnel with port forwarding.


        - configure your router to forward [ip-outside]:3306 to [ip-maria-db-server]:22

        - on your pc run and leave it run:
        plink [ssh-user]@[ip-outside] -P 3306 -v -t -C -N -L -pw [ssh-user-password]

        - use any mysql\mmariadb client you want and connect it to localhost:3306. as db user\pw you can use whatever you use locally on your db server as mariadb will see the db client connection coming from localhost

        plink is a tool included with putty

        if the connection is not stable, plink could disconnect and your db client will stop working.
        In that case you can create a simple batch with a loop
        plink .....
        goto restart


        • #5
          For some routers just redirecting the port is not enough. You also have to explicitily enable access on the port.


          • #6
            I forgot this :/

            Finnally I did an ssh tunnel as explained, and works like a charm.

            Professional Scriptcase Services
            Some Customers opinions