Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. The Lounge
  4. How to access a DB that is on a remote server?
Forum Updated to NodeBB v4.3 + New Features

How to access a DB that is on a remote server?

Scheduled Pinned Locked Moved Unsolved The Lounge
14 Posts 9 Posters 2.4k Views 2 Watching
  • 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.
  • U U7Development

    Hi mates...

    In the past was really easy to setup a server using IIS on Windows on a Web based server, where all clients access via browser using a dyndns url, i only needed to forward port 81 to get access to my web site.

    Now, with Qt, i have done my client as a desktop application, so as you can see, i guess there is nothing to do with port 80, 81 etc...

    The web-based client flow is : internet client via web browser -> server web browser -> database.

    In Desktop is direct : internet client desktop -> server database

    My Server in this case has MariaDB using port number 3306, root & pass and a no-ip url to get from outside.. No-IP is already setup and working, but i have no idea how i need to configure my server to make it listen my outside client... Do i still need to forward the server lan ip on the router?..

    Thanks in advance.

    artwawA Offline
    artwawA Offline
    artwaw
    wrote on last edited by
    #5

    @U7Development also, you wrote:

    My Server in this case has MariaDB using port number 3306, root & pass and a no-ip url to get from outside.. No-IP is already setup and working, but i have no idea how i need to configure my server to make it listen my outside client... Do i still need to forward the server lan ip on the router?
    

    My understanding is that you have the server on the LAN somewhere and would like to connect remotely over the Internet?
    In this case you need to forward the port of the DB from the outside (the internet) to point into your server's ip (inside) on your router. This can be done as a simple port forwarding/triggering in simpler models of the routers.

    To connect you'll need to know public IP (or URL should you have one) of the router and use this to connect. That kind of setup might be tricky though if you have dynamic IP address on the router (and setting this up is a bit outside of topics on this forum).

    For more information please re-read.

    Kind Regards,
    Artur

    U 1 Reply Last reply
    3
    • artwawA artwaw

      @U7Development also, you wrote:

      My Server in this case has MariaDB using port number 3306, root & pass and a no-ip url to get from outside.. No-IP is already setup and working, but i have no idea how i need to configure my server to make it listen my outside client... Do i still need to forward the server lan ip on the router?
      

      My understanding is that you have the server on the LAN somewhere and would like to connect remotely over the Internet?
      In this case you need to forward the port of the DB from the outside (the internet) to point into your server's ip (inside) on your router. This can be done as a simple port forwarding/triggering in simpler models of the routers.

      To connect you'll need to know public IP (or URL should you have one) of the router and use this to connect. That kind of setup might be tricky though if you have dynamic IP address on the router (and setting this up is a bit outside of topics on this forum).

      U Offline
      U Offline
      U7Development
      wrote on last edited by
      #6

      @artwaw

      Thanks Artur...
      So practically the only thing i need to do is to portforward port 3306 for the server ip on LAN 192.168.1.200 and automagically DB will be available for remote Qt desktop client isn't ?

      artwawA 1 Reply Last reply
      0
      • U U7Development

        @artwaw

        Thanks Artur...
        So practically the only thing i need to do is to portforward port 3306 for the server ip on LAN 192.168.1.200 and automagically DB will be available for remote Qt desktop client isn't ?

        artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by artwaw
        #7

        @U7Development In theory, yes. In practice there still might be network issues preventing successful connection (that kind of setup is quite complicated to debug as there might be both software compatibility issues and routing issues on the network). Try it, see if it works.
        Also, if your router permits any kind of logging it might be worth settings this up to monitor network connectivity - especially with regards to port forwarding.
        Side note - please check if your router allows exposing "applications" to the outside interface, some built in router firewalls have that option. From my experience using this option in the router firewall works more often than simple port forwarding.
        As I said, there are multiple non-exclusive points of failure in that kind of setup.

        For more information please re-read.

        Kind Regards,
        Artur

        U 1 Reply Last reply
        4
        • artwawA artwaw

          @U7Development In theory, yes. In practice there still might be network issues preventing successful connection (that kind of setup is quite complicated to debug as there might be both software compatibility issues and routing issues on the network). Try it, see if it works.
          Also, if your router permits any kind of logging it might be worth settings this up to monitor network connectivity - especially with regards to port forwarding.
          Side note - please check if your router allows exposing "applications" to the outside interface, some built in router firewalls have that option. From my experience using this option in the router firewall works more often than simple port forwarding.
          As I said, there are multiple non-exclusive points of failure in that kind of setup.

          U Offline
          U Offline
          U7Development
          wrote on last edited by
          #8

          @artwaw yes, agreed... i need to contact to my ISP to check if my modem-router is enabled to port forwarding or permit access from outside by firewall as you said..... otherwise i will need to buy a custom router and set ISP modem to Bridge..

          Thanks !

          jsulmJ 1 Reply Last reply
          0
          • U U7Development

            @artwaw yes, agreed... i need to contact to my ISP to check if my modem-router is enabled to port forwarding or permit access from outside by firewall as you said..... otherwise i will need to buy a custom router and set ISP modem to Bridge..

            Thanks !

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #9

            @U7Development You should seriously rethink your approach - exposing databases directly to the Internet isn't a good idea...

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            4
            • B Offline
              B Offline
              Bur8rus
              Banned
              wrote on last edited by Bur8rus
              #10
              This post is deleted!
              1 Reply Last reply
              0
              • P Offline
                P Offline
                Pollock95
                Banned
                wrote on last edited by Pollock95
                #11
                This post is deleted!
                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  Fugate251
                  Banned
                  wrote on last edited by
                  #12
                  This post is deleted!
                  1 Reply Last reply
                  1
                  • D Offline
                    D Offline
                    David142
                    Banned
                    wrote on last edited by
                    #13
                    This post is deleted!
                    1 Reply Last reply
                    0
                    • Christian EhrlicherC Offline
                      Christian EhrlicherC Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #14

                      Locking this topic - attracts spammers.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved