简体   繁体   English

从另一个IP地址连接到xampp mysql

[英]connect to xampp mysql from another ip Address

I have created a xampp Server in my office which can be used from the office via any pc when they are connected to the same network. 我在办公室中创建了一个xampp服务器,当它们连接到同一网络时,可以通过任何PC在办公室中使用它们。 but when I connect using my personal internet it doesn't connect to the xampp server. 但是当我使用个人互联网进行连接时,它无法连接到xampp服务器。 Is there any setting to make the server globally connect by anyone even they are not in same network. 是否有任何设置可以使服务器建立全局连接,即使他们不在同一网络中也是如此。

You must setup and public virtual servers on your modem/ router 您必须在调制解调器/路由器上设置和公共虚拟服务器

For example on my TL-WR841N: 例如在我的TL-WR841N上:

go to: menu->Forwarding -> Virtual Servers 转到:菜单->转发->虚拟服务器

Virtual Servers 虚拟服务器

Service Port: 80 服务端口:80

Internal Port:80 内部端口:80

IP Address : your static LAN IP_Address IP地址:您的静态局域网IP_Address

protocol: ALL 协议:全部

You can access to your web via ip: Your internet IP:80 您可以通过ip访问您的网站:您的互联网IP:80

for example my server: 27.72.173.170:80 例如我的服务器:27.72.173.170:80

If you want to access via domain: 如果要通过域访问:

Config your Xampp virtual host at (Your xampp directory)\\apache\\conf\\extra\\httpd-vhosts.conf: 在(您的xampp目录)\\ apache \\ conf \\ extra \\ httpd-vhosts.conf中配置Xampp虚拟主机:

And add: 并添加:

<VirtualHost *:80>
ServerAdmin webmaster@yourdomain
DocumentRoot "D:/xampp/htdocs/yourwebdir"
ServerName yourdomain
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
<Directory "D:/xampp/htdocs/yourwebdir">
Options Indexes
AllowOverride All
Require all granted
</Directory>

You need to port forwarding using your router panel (depends on your router specification). 您需要使用路由器面板进行端口转发(取决于路由器规格)。

Port-forward : 转发端口:

  • 80 (apache/webserver) 80(Apache /网络服务器)
  • 3306 (mysql) 3306(mysql)

港口示例


reference 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM