Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Connect to MySQL server

Connect to MySQL server

Scheduled Pinned Locked Moved Database
sysadminc++databasemysqlhelp
9 Posts 5 Posters 0 Views 1 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.
  • 1 Offline
    1 Offline
    1 fcb1913
    wrote on last edited by
    #1

    Hallo, I cannot connect to MySQL database from PC outside home network. I created client aplication in c++ to editing data in MySQL database. We have 2 PC at home. Both PC has the same TCP/IP address like xxx.xx.xx.xx. PC with MySQL server has IPv4 address 10.10.11.93. I tried to type xxx.xx.xx.xx/10.10.11.93 but error is occurred: 2005: unknown MySQL server host "xxx.xx.xx.xx/10.10.11.93" ( 11004). I can connect to the database from second PC at home wrighting the name of PC with MySQL server. What I have to write to connect from outside? Thanks.

    L J B 3 Replies Last reply
    0
    • 1 1 fcb1913

      Hallo, I cannot connect to MySQL database from PC outside home network. I created client aplication in c++ to editing data in MySQL database. We have 2 PC at home. Both PC has the same TCP/IP address like xxx.xx.xx.xx. PC with MySQL server has IPv4 address 10.10.11.93. I tried to type xxx.xx.xx.xx/10.10.11.93 but error is occurred: 2005: unknown MySQL server host "xxx.xx.xx.xx/10.10.11.93" ( 11004). I can connect to the database from second PC at home wrighting the name of PC with MySQL server. What I have to write to connect from outside? Thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      1.fcb1913 wrote:

      What I have to write to connect from outside?

      In a default-installation, it's not possible to make a connection to the server from the outside world. The idea behind that being that you can install a server, without having to worry about me poking at the password over the internet. You'll have to check the local firewall, and, if it's a home-PC, your router. If that last is the case, you can go to this site[^], and click on "More about you" on the left; it'll load a new page, hopefully with a hostname. If not, you can still connect using the IP-adress, given that the server is configured and reachable.

      Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]

      1 1 Reply Last reply
      0
      • L Lost User

        1.fcb1913 wrote:

        What I have to write to connect from outside?

        In a default-installation, it's not possible to make a connection to the server from the outside world. The idea behind that being that you can install a server, without having to worry about me poking at the password over the internet. You'll have to check the local firewall, and, if it's a home-PC, your router. If that last is the case, you can go to this site[^], and click on "More about you" on the left; it'll load a new page, hopefully with a hostname. If not, you can still connect using the IP-adress, given that the server is configured and reachable.

        Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]

        1 Offline
        1 Offline
        1 fcb1913
        wrote on last edited by
        #3

        On MySQL server is enabled TCP/IP networking, firewall exception for port and enabled root access from remoute machines. I know my TCP/IP - is static. If I'm trying to connect from outside home network, a firewall don't notice anything. I can connect from another PC at home network. What I have to do to connect from outside?

        L 1 Reply Last reply
        0
        • 1 1 fcb1913

          On MySQL server is enabled TCP/IP networking, firewall exception for port and enabled root access from remoute machines. I know my TCP/IP - is static. If I'm trying to connect from outside home network, a firewall don't notice anything. I can connect from another PC at home network. What I have to do to connect from outside?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          1.fcb1913 wrote:

          What I have to do to connect from outside?

          I suggest you run a little webserver, and use that to verify whether you can connect. If you can't serve a page from the machine, then you won't be able to use a database remotely. The logical steps would be something like - verify connectivity - verify db-server is running - verify local connectivity - verify remote connectivity If your PC is "at home", chances are your router has it's own firewall. Check the manual to verify - the router-setup varies per product. I changed something called "NAT", pointing from the outside to the static IP on the inside-network. (The numbers inside the network should be different from those outside, and you'd be using the outside-number to connect)

          Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]

          1 Reply Last reply
          0
          • 1 1 fcb1913

            Hallo, I cannot connect to MySQL database from PC outside home network. I created client aplication in c++ to editing data in MySQL database. We have 2 PC at home. Both PC has the same TCP/IP address like xxx.xx.xx.xx. PC with MySQL server has IPv4 address 10.10.11.93. I tried to type xxx.xx.xx.xx/10.10.11.93 but error is occurred: 2005: unknown MySQL server host "xxx.xx.xx.xx/10.10.11.93" ( 11004). I can connect to the database from second PC at home wrighting the name of PC with MySQL server. What I have to write to connect from outside? Thanks.

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #5

            1.fcb1913 wrote:

            server has IPv4 address 10.10.11.93. I

            That is a private IP address. It is NOT possible to address a private IP address on the internet. There is absolutely no way to do it. Your options are - Figure out your public IP address, which your ISP has given you. There is NO guarantee that you have a public IP address. However if you have one then your cable modem would be the one that has it. You would need to set up your modem to redirect requests to your box. - Buy a public IP from your ISP. Then do the above.

            1 1 Reply Last reply
            0
            • 1 1 fcb1913

              Hallo, I cannot connect to MySQL database from PC outside home network. I created client aplication in c++ to editing data in MySQL database. We have 2 PC at home. Both PC has the same TCP/IP address like xxx.xx.xx.xx. PC with MySQL server has IPv4 address 10.10.11.93. I tried to type xxx.xx.xx.xx/10.10.11.93 but error is occurred: 2005: unknown MySQL server host "xxx.xx.xx.xx/10.10.11.93" ( 11004). I can connect to the database from second PC at home wrighting the name of PC with MySQL server. What I have to write to connect from outside? Thanks.

              B Offline
              B Offline
              Bernhard Hiller
              wrote on last edited by
              #6

              Depending on the hardware for connecting your local intranet to the internet, it may be possible to set-up a "port forwarding": that means, you send the request to your public ip address with a port specified, and the router then forwards the request to an internal computer and that port. To get your public ip address, you can use tools like dyndns.

              P 1 Reply Last reply
              0
              • J jschell

                1.fcb1913 wrote:

                server has IPv4 address 10.10.11.93. I

                That is a private IP address. It is NOT possible to address a private IP address on the internet. There is absolutely no way to do it. Your options are - Figure out your public IP address, which your ISP has given you. There is NO guarantee that you have a public IP address. However if you have one then your cable modem would be the one that has it. You would need to set up your modem to redirect requests to your box. - Buy a public IP from your ISP. Then do the above.

                1 Offline
                1 Offline
                1 fcb1913
                wrote on last edited by
                #7

                Thanks. I have public IP address. On a chimney we have white cubic transmitter-receiver and one cable ended with a switch from witch the computers are connected. I don't know if it is router or modem. I tried typed my public IP address, IPv4 address, gate IPv4 and server DNS IPv4 address into web browser to set up connection, but always connect error is occured. I have contacted my internet provider, I hope he'll resolve this.

                P 1 Reply Last reply
                0
                • B Bernhard Hiller

                  Depending on the hardware for connecting your local intranet to the internet, it may be possible to set-up a "port forwarding": that means, you send the request to your public ip address with a port specified, and the router then forwards the request to an internal computer and that port. To get your public ip address, you can use tools like dyndns.

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #8

                  Yes, port forwarding and using a dyndns tool should be able to work.

                  "Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus

                  1 Reply Last reply
                  0
                  • 1 1 fcb1913

                    Thanks. I have public IP address. On a chimney we have white cubic transmitter-receiver and one cable ended with a switch from witch the computers are connected. I don't know if it is router or modem. I tried typed my public IP address, IPv4 address, gate IPv4 and server DNS IPv4 address into web browser to set up connection, but always connect error is occured. I have contacted my internet provider, I hope he'll resolve this.

                    P Offline
                    P Offline
                    Paul Conrad
                    wrote on last edited by
                    #9

                    Have you tried using port forwarding as Bernhard has suggested?

                    "Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups