Setting up MySQL database behind a VPN address - mysql

I have a regular MySQL server running with XAMPP at port 3306 and accessible by my internet ip aswell my local ip (127.0.0.1), the ports are forwarded in my router. An account set up to be accessed from any IP, Everything works fine.
I'm trying to make this same server be accessible by AirVPN DNS address. So I've followed AirVPN instructions to remove the forwarded ports in my router and forward a new port at their VPN with a random number (lets go with 1111) with local port as 3306 and DNS named as xxx.airdns.org
So I open MySQL with XAMPP under port 3306, nothing changed in config file. I run the AirVPN port checker over 1111 and it signals as open. I also try at other sites that checks ports and signals open at xxx.airdns.org:1111
Though when I try to make a connection as usual it returns error (10060): Can't connect to MySQL server on 'xxx.airdns.org' (10060)
Resolutions I've tried:
Switch port values in MySQL config files matching with the ports open in AirVPN
bound address to VPN adapter bind-address="10.6.114.48"
repeated the options above in all different kind of port combinations and addresses
Disabled Firewall on Ethernet adapter of VPN as described here
I couldn't achieve success in this task. I'm looking for some enlightment so I can understand the process.
EDIT:
The connection is set only to TCP protocol. A port check done through airVPN and is registered at XAMPP & FIREWALL logs as accepted connections. Though trying to connect from a client I got no log from Xampp or Firewall, it gets timed out.

Sorry for "answer" type not just comment, but i dont have enough reputation here :)
Maybe the protocol ( TCP/UDP ) is your issue.
If you use UDP on your airVPN better check forwarding on your router - most of them
by default sets TCP only. Otherwise maybe change to TCP on your airVPN.
ISP provider often filter this protocol.

Issue: Consider that you can't connect to a service running "behind" some VPN server from a machine that's connected to that very same VPN service.
Solution: Connect from another machine to test your service properly.

Related

MySQL Remote Connection (Replication)

I have the following topology.
One Ubuntu 16.04. Instance on the Amazon AWS where my global MySQL Server is running. I want to use this Server as a Slave (Multi-Source Replication) for many local Master (Windows Machines MySQL Server).
For Testing Reasons I`ve Managed to make this running on one local Machine (with three different MySQL Server Running).
But now I want to make this Replication work on the mentioned global Server with the local ones. But it fails on the attempt to connect from the EC2 ubuntu Instance to the local Windows MySQL Server.
When I try to connect from my EC2 Instance to the local Computer with MySQL running on Port 3307 it keep saying:
ERROR 2003 (HY000): Can't connect to MySQL server on (113)
The strange Part is, that I can PING the Local Computer but not telnet it.
Telnet just says:
telnet: Unable to connect to remote host: No route to host
I can access the Global (EC2 / Ubuntu MySQL Server) from the local Machine but not the other way around.
I`ve already made a new Rule for this Port on the Windows Firewall Settings.
But the Port 3307 on the IPv4 Address seems to be still Closed.
I have no clue what I am missing to get a Connection from the EC2 Instance to my local Computer via TCP.
Do I have to open the Port Specific on the Router?
I hope for your help.
Best Regards.
It seems like your local computer is not visible, as your incoming ports to your local pc are closed. It may be a problem with your router, or your internet service provider, which is not allowing you to open ports(the most common one).
The possible solutions are:
1.) If your ports are not open due to the router
Try forwarding required ports to your pc.
Try Switching off your NAT firewall that may be blocking ports.
Try switching off your windows or antivirus firewall if any.
2.) If your ports are blocked by your Internet service provider.
Try getting help from ISP
Switch to a static IP connection if on dynamic.
Use a VPN service that provides an unblocked port service to all IPs.(This one solved my problem when I was struck in this situation.)

People on an other network can't connect to my WAMP server

I'm trying to host a WAMP server (WAMP version 3.0.6 on windows 10) and http:'//localhost, my internal IP and external IP (I forwarded port 80) are working. I Also registered a free .tk domain that's working on my network. But on other WiFi networks people can't connect to my server using my external IP or my domain.
I tested it on my smartphone (using mobile data to simulate the other WiFi network) and I got the error [My server's IP] took too long to respond.
How can I fix this?
In this case you have to make sure that the router is firstly directing to your server machine(local IPs generally have the form 192.168.x.x) and to the correct port ,so if WAMP's Apache is running on port 80 router must redirect to your machine's 80 port.
I've fixed it.
I double checked my port forwarding settings and changed the external IP from port 80. Then I saw a text: "When the External IP address is 0.0.0.0 you can access this port forwarding on internet, if you set a specific External IP address here the access is limited to only this IP address on internet", so I changed my external IP to 0.0.0.0 and now it's working!

Connect SQL Server 2008 r2 through Internet

I have a VB.NET application that can connect to the SQL Server through LAN base, but how can I connect to it through internet, the application need to use outside, I know i need to use the public IP instead of using the IP address of the server but my public IP address that I've set in connection string can't connect to the server, Here's my connection string
Dim connstr$ = "Server=xxx.xx.xx.xxx\SQLEXPRESS,xxxx;Initial Catalog=sample_db;Integrated Security=True
Public conn As New SqlConnection(connstr)
I've try also to set the port and change the firewall restriction,enabled the TCP etc. and search a lot here but still doesn't work
Here's our network setup
PC-->router-->internet modem
1433 is the default sql server communication port. Port 1433 should be forwarded to the local IP address where your sql server runs.
1) Make sure that port 1433 is the valid communication port for sql server. You can check it from sql server configuration tools. Use actual port number rather than 1443 if it was changed by someone.
2) Find NAT (Network address translation) menu in your modem or router administration panel.
3) Forward port 1433 to your server's local IP address
4) Restart device
As a note that, your modem does not require a static IP. Your device most probably might have a new IP address after every restart. But it would be valid until you restart it once more. You can use this IP address in order to access your database remotely. It would be better but you don't have to get a static IP address.
UPDATE: You should also be sure that, port is not blocked by a program on the server such as a virus or security program.
Good luck
Google "port forwarding", which is also called Network address translation or "NAT".
The other answers are perfect but searching for the term on google should get you an idea on what it is, and how to go about it. Add your router name to the search for exact steps.
In short forward the port that SQL Server is listening on, from the router to the server machine. You will need to do some configuration on the router for that by opening the admin page. For how and details, Google "port forwarding"

Turning off windows firewall while sharing Mysql Database through LAN?

In case of not turning the Firewall off:
after pinging the IP the Request time out will appears,
but after turning off the firewall it will reply.
Why?
I am using Mysql with Java, the question not related with java but maybe java programmers get something like this issues with sharing the database.
Your firewall will block access to port 3306 (default port for MySQL). To get it to work without turning the firewall off, you will have to configure the firewall to let connections to port 3306 (other whatever port is configured in your my.cnf) through.

Manage mySQL DB by using phpMyAdmin and point browser to ip

Hi I am completely new to phpMyAdmin and mySQL
Is there any way to configure remote management/access of my MySQL database by pointing requests or a browser to an IP? I have my server set up behind a router and have setup port forwarding for ports 8080 (tomcat) and 3306(should be default mySQL). Everything works locally on the machine, however I cannot access the dbs or phpmyadmin by pointing a browser from a computer on the local network to http://IP/phpmyadmin or from externally by pointing the browser to the IP given to me by my ISP. Any thoughts? Is there a specific way to edit the config files in order to allow the use of IP addresses?
Exposing your db and appserver on the internet is not a good idea. If these need to be accessed remotely, use a VPN or authenticated SSL. In the case of phpmyadmin - if this is running on a webserver on your network then you'll need to forward port 80 too - although I'd recommend using HTTPS/SSL (port 443)