What are the differences between a proxy, a port and a server. Also, what is the difference between local server and mysql sever and how we can differentiate among them ?
Thanks in advance.
Ports: connection between 2 computers/interfaces or more using ports is more like a gate where the IP addresses pass.
Server: give different services for one client or more over the network.
Proxy: middle station between the server and the client.
Local: internal network or using loop interface, network card can be a server and also a client in the same time without going out side the network.
Mysql server is service for database, using default port 3306, it's have is own IP address and you can connect him depends on the firewall rules and routing.
Knowing this topics is not enough you need to cover all the network theory it's combine a lot of parts that only when you connecting all of them together you getting the entire picture....
https://en.wikipedia.org/wiki/Proxy_server
https://en.wikipedia.org/wiki/Server_(computing)
https://en.wikipedia.org/wiki/MySQL
Related
I've some mysql host in private network and would like to use a reverse proxy server (i.e. nginx) to connect with mysql-client to mysql host via reverse proxy server.
An example to better understand my answer:
suppose I've:
a mysql server with ip yyy.1
a mysql server with ip yyy.2
both in the network of a proxy server with ip XXX, and I associate to XXX the DNS mysql-server1.com and mysql-server2.com.
My goal is connect to mysql server yyy.1 when I use mysql client to connect to XXX by calling mysql-server1.com on port 3306, and similare when try mysql-server2.com on port 3306.
The problem with nginx is that I can't differenciate TCP request by server name, so in XXX server I should associate one port foreach mysql server, but this implies that every time I should change the port also in mysql client settings, and I don't wanna this!
There's some proxy-server that can accomplish that?
Could I use IP Table to route the request mysql-server1.com:3306 to localhost:[some port], where I could use [some port] in proxy setting to forward the requests to the server yyy.1?
This is impossible.
In the MySQL Client/Server protocol, the client never identifies the hostname to which it is attempting to connect to. Unlike in some other protocols, such as HTTP (with the Host header), the original name the client used to resolve an IP address from DNS is not preserved. TLS SNI is also not available, because TLS negotiation on a MySQL connection does not begin until the client reads the server capability flags to discover whether the server supports TLS, at which point the client asks to switch the connection to TLS... and this, of course, is after the connection is is already established.
In the MySQL Client/Server protocol, the server always talks first.
Your only options are for the proxy machine to listen on multiple IP addresses, with a DNS hostname pointing to each IP, and use the address to which the client connected to determine which server to use.
Or, each proxy instance listens on a separate port.
The protocol design prevents name-based virtual hosting.
I am using a software - (Ingress) by FingerTec which uses mysql database.
Some setups of this system are only using a single installation - consisting of a mysql server and a client locally on the same machine.
I have been having issues since I started to use the software when it is installed on a user's laptop/PC. The problem is that frequently when running the mysql server and client, a window pops up asking for the local IP address and port (127.0.0.1 and 3306 by default). To continue using the software, one needs to run IngressDB installer where you need to 'Update Connection' by giving the root user and pass for mysql and then 'Upgrade Database' to refresh the database for any new settings. After this step the software runs fine.
Yesterday I managed to simulate this issue by changing the static IP on my laptop while connected directly to one of their Access Controllers. I had to re-Run Ingress DBinstaller.
Now my question is this:
When using your machine(laptop/pc) it is normally getting IP add, def GW, Subnet etc from a dhcp server therefore there is no guarantee that you will always get the same IP leased unless there is a reservation to the machine's mac address.
As described earlier - when ever there is a change of IP address leased from DHCP, a window pops up showing the loopback address 127.0.0.1 and the mysql port 3306. So it never shows the local IP address (ex. 192.168.1.100). So I was thinking - why is the loopback IP not enough for mysql client/server as this stays the same forever.
Is is normal that software using mysql database server requires a static local IP on the machine hosting it? I am referring only to instances where both mysql server and client reside on the same machine.
I appreciate your thoughts about this and maybe any other way I can get around this apart from making an IP address reservation in the DHCP server. Setting a static IP address manually on the LAN adapter is no solution for me as this would limit the machine to connect only to a certain network and cannot be used at other places.
If the client is the same local machine as the server, the MYSQL server specifically does not need a static IP because it pretty much already has one: 'localhost' or '127.0.0.1'. If the client is not on the same machine as the server, the server would need a static IP.
If the machine is acting as a server for other content, yes, it would need a static IP. If you're doing this at home, chances are that your access point will let you configure it for a static IP.
I'd like to know how to connect the client pc in a outside network for example a WAM network, i have my database in my pc and i use this like the server. I know how to connect mysql with another client computer inside the LAN network but i dont know how to do it like the other way.
if you don't understand something make me know.
PD: sorry for my english is my first question on a english forum
Ultimately it works exactly the same way - you need an IP address and a port to connect to your database on. You can either do this by setting up port-forwarding at the firewall on the network with the database server (basically, forward port 3306 to the LAN IP address), or by giving the database server a publicly available static IP and then opening port 3306 in any firewalls. Alternatively, you can set up a VPN to the network with the database server, and connect through this. If done right, the VPN option is much more secure.
However, you should ask yourself why you want to do this. Is your idea to have a client software that directly connects to the database? This is not a great design - it's usually better to have a backend database that is accessed via a frontend API (e.g. a RESTful API or similar). Among other benefits, this can give you much better (finer-grained) access control to the database.
Your MySql server should have a firewall rule to accept outside connection on MySql port (default is 3306). Best setup should allow connection from your clients WAN address only.
Then, your C# connector will be able to connect just the same as in LAN.
I am trying to connect Mysql with third party application with Zaiper. does zaiper support access to local Mysql databases?. i tried using IP: 54.86.9.50 and port;3306 but i get 504: Gateway Timeout
Thanks
Zapier developer here.
The short answer is no, you can't connect to a local database. That's because if you try to use localhost or 127.0.0.1 in the Zap, that would attempt to connect to a database on our server.
If you really wanted, you could send traffic to the IP address of your local router and then have it forward the traffic to your developer machine. Be advised there are some security risks involved with as you are opening up a port for any inbound traffic from the outside world.
Another solution is to snag an RDS instance from Amazon and use that for your Zap.
I have built an application in vb.net that needs to connect to a mysql database. This all works fine from my own network and several other home networks.
But if i want to use the application on my company's network, i get the error
Unable to connect to any of the specified MySQL hosts
I thought that this is caused by the firewall of the network.
But I used the "automatic update" option and I publish the application on a online server. This works fine on my company's network.
So the application can download the updates from the network, but can't connect to the mysql server. What could cause this issue?
The most common situation that would cause this is selective egress filtering. Specifically, the firewall is most likely only allowing HTTP/HTTPS port connections out.
Try changing mysql to listen on 443, then try again using 443 instead. The firewall may allow the traffic since it is using 443 like web traffic instead of 3306 (mysql default).
If you're testing it locally, its because you need to whitelist the IP that you're CURRENTLY on.
On live sites, the IP of the server doesn't change. So you use that IP with the correct permissions to allow mysql to work.
So basically, figure out where your allowed IP's to talk to the DB are, find your local ip, and modify. Incorrect ports can be a problem also