通过两个不同的网络连接Mysql [英] Mysql connection thru two different networks

查看:376
本文介绍了通过两个不同的网络连接Mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我一直在网上闲聊,以回答我的这个问题。我在我的电脑上安装了一个MySQL数据库作为服务器。我还有两个不同的应用程序在这台PC上使用MySQL数据库。但是,pc(安装MySQL数据库)只能通过lan电缆连接到交换机。我配置网络和应用程序通过lan和wan连接到具有mysql的电脑,这没关系。过了一段时间,我通过光缆接到另一个互联网连接,并连接了不同的网关。

问题是如果我将带有mysql的电脑连接到具有不同网关的光纤电缆,我的一个应用程序无法连接到数据库。



我的问题是,两个不同的网关能够连接到只有一台带有mysql数据库的PC吗?如果是的话,请你提供我的提示或链接。提前致谢



我尝试了什么:



我试过google搜索作为答案但由于某种原因我只能从网络中的任何地方远程访问mysql数据库,这只是在mysql中创建一个通配符用户并授予它所有权限。超级用户或通配符用户是否可以在两个不同的网关上连接它?我不确定,但会查看它。

Hi all!

Ive been rambling on the net for an answer to this question of mine. I have an MySQL database installed on my pc acting as a server. I also have two different applications that uses the MySQL databases on this pc. However, the pc(where MySQL database is installed) is only connected thru a switch via lan cable. I configured the network and the apps to connect to the pc with mysql via lan and wan, which is ok. After some time, I received another internet connection via fiber optic cable with a different gateway to be connected.
The problem is if i connect the pc with mysql to the fiber optic cable which has a different gateway, one of my apps cannot connect to the database.

My question is can two different gateway able to connect to only one pc with mysql database? If so, can you please give my hints or links. Thanks in advance

What I have tried:

I tried googling for an answer but for some reason I only get how to remotely access the mysql database from anywhere in a network, which is simply to make a wildcard user in the mysql and grant all priviledge on it. Will a superuser or a wildcard user can connect it on two different gateways? Im not sure but will look on it.

推荐答案

这可能不是MySQL问题,而是网络设置/配置问题。



据我所知,您的服务器现在有两个网络连接。比它还有两个IP地址。



我建议配置和检查这些服务器端设置:



  • 让MySQL服务侦听所有网络接口或应该使用的接口。

  • 确保使用的接口/ IP的传入流量允许(服务器和服务器端路由器上的防火墙)。

This is probably not a MySQL problem but a network setup / configuration problem.

As far as I understand your server has now two network connections. Than it will also have two IP addresses.

I suggest to configure and check these server side settings:

  • Let the MySQL service listen on all network interfaces or the one that should be used.
  • Ensure that incoming traffic to the used interfaces / IPs is allowed (firewalls on server and server side routers).


  • 确保客户端和客户端路由器上的任何防火墙都不阻止流量。

  • 尝试连接到服务器首先使用IP号而不是使用DNS名称。

  • 如果您的服务器有DNS名称,则可能是旧连接而不是新光纤电缆。对于新连接,您必须设置新的DNS名称或使用IP地址。


这篇关于通过两个不同的网络连接Mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆