Good day. I am trying to connect with a PHP script (on hosting) to a computer with SQL Server. The problem is that the PC network through the router via ADSL go to the Internet under a single static IP. How in this case to make connection?
2 answers
It is necessary to configure the so-called port forwarding on the router. In DLink, for example, this section is called Port Mapping. The port and the computer ip on the internal network are indicated, where the connection needs to be transferred. MySQL has default port 3306
- Those. for example, if I set up a router for forwarding port 1433 for PC1 with a lok address, for example, 192.168.1.77, then if I call from outside to address 123.123.123.123,1433 - will this be PC1? - Afipsky pm
- Yes exactly. However, the ports do not have to be the same. You can, for example, set up forwarding from 123.123.123.123:14331 to 192.168.1.77:1433, from 123.123.123.123:14332 to 192.168.1.78:1433, etc. - Ilya Pirogov
- yes, just like that - Enpire
|
Take an external IP for a computer with a server or reconfigure the router
- External IP all computers one. - Afipsky
- And I say, you need to take a separate external IP for the server =) Many providers have this service, often paid. Just incl. for your purposes. - Sh4dow
|