简体   繁体   English

MySQL:Error 2003丢失了来自同一本地网络上的虚拟机的连接

[英]MySQL:Error 2003 lost connection from a virtual machine on the same localnetwork

Apologies for the bad english, i'm french. 不好意思的英语,我是法语。 :D :d

I've been looking for an answer since approximatively 4 days, and I don't know how to fix my issue. 从大约4天开始,我一直在寻找答案,但我不知道该如何解决。

So: 所以:

I want to virtualize two servers using virtualBox on Windows7 and i want them all on the same local network. 我想使用Windows7上的virtualBox虚拟化两台服务器,并且希望它们都在同一本地网络上。 My VMs are running on Ubuntu 16.04 我的VM在Ubuntu 16.04上运行

On the first VM I installed a lamp web server with MySQL 5.7 and i add phpmyadmin. 在第一个VM上,我安装了带有MySQL 5.7的Lamp Web服务器,并添加了phpmyadmin。 On the second VM I installed Jira standalone 在第二台VM上,我独立安装了Jira

--> I need to connect to my Database from my Jira server ->我需要从我的Jira服务器连接到我的数据库

So I used the Bridge adapter on each machine: 因此,我在每台计算机上使用了网桥适配器:

network configuration 网络配置

network configuration 网络配置

Ip adresses are attributed with the DHCP protocol. IP地址归功于DHCP协议。

  • The SQL machine ip is 192.168.6.80 SQL机器的IP为192.168.6.80

  • The Jira machine ip is 192.168.6.101 Jira机器IP为192.168.6.101

  • The Host machine ip is 192.168.6.87 主机IP为192.168.6.87

I'm able to ping each machine so there is no problem. 我能够对每台计算机执行ping操作,因此没有问题。


  1. SQL server SQL服务器

When I start the machine everything seems to work, i can access from my SQL server: 当我启动机器时,一切似乎都可以正常工作,我可以从我的SQL服务器进行访问:

localhost : home page of apache 2 saying "It Works" 本地主机 :apache 2的主页,上面写着“ It Works”

localhost:5671 : 本地主机:5671

[ 5.7.18-0ubuntu0.16.04.1 UKBeM ÿ÷ ÿ T(DGKg1hwd= mysql_native_password ÿ„Got packets out of order [ 5.7.18-0ubuntu0.16.04.1 UKBeM ÿ÷ ÿ T(DGKg1hwd = mysql_native_password ÿ„

localhost/phpmyadmin : the index page where I can connect perfectly with root. localhost / phpmyadmin :我可以与root完美连接的索引页面。


  1. Host Machine (Windows) 主机(Windows)

192.168.6.80 : home page of apache 2 saying "It Works" 192.168.6.80:apache 2的主页说“ It Works”

192.168.6.80:5671 : 192.168.6.80:5671

[ 5.7.18-0ubuntu0.16.04.1 UKBeM ÿ÷ ÿ T(DGKg1hwd= mysql_native_password ÿ„Got packets out of order [ 5.7.18-0ubuntu0.16.04.1 UKBeM ÿ÷ ÿ T(DGKg1hwd = mysql_native_password ÿ„

192.168.6.80/phpmyadmin : the index page where I can connect perfectly with root. 192.168.6.80/phpmyadmin :我可以与root完美连接的索引页面。


  1. Jira server 吉拉服务器

Here when i start the machine it works during approximatively 2-3 minutes, I'am able to connect via: 在这里,当我启动机器时,它可以在大约2-3分钟内正常工作,我可以通过以下方式进行连接:

mysql -u root -p -h 192.168.6.80 -P 5671 

I am perfectly connected and i can also access to all the other adresses. 我之间的联系非常紧密,我也可以使用所有其他地址。

And then it stop working on this machine only. 然后,它仅在这台机器上停止工作。

Unable to connect 无法连接

Firefox can't establish a connection to the server at 192.168.6.80. Firefox无法在192.168.6.80建立与服务器的连接。

The site could be temporarily unavailable or too busy. 该站点可能暂时不可用或太忙。 Try again in a few moments. 请稍后重试。

If you are unable to load any pages, check your computer's network connection. 如果您无法加载任何页面,请检查计算机的网络连接。

If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web. 如果您的计算机或网络受到防火墙或代理的保护,请确保允许Firefox访问Web。

And when i re-try to connect via mysql on terminal I get the Error 2003 (HYOOO) 当我尝试通过终端上的mysql连接时,出现错误2003(HYOOO)

This happen only when i use the connection of my work, at home it works perfectly without stopping!! 仅当我使用我的工作连接时,才会发生这种情况,在家中它可以不停地完美运行!!

I have few leads: 我的线索很少:

  • problems of proxy authentication 代理认证的问题
  • problems of firewall configuration 防火墙配置问题

i am in a private network with a domain name called something.eu And when i launch firefox the proxy shows up automatically: and-etc-ha.something.eu:9090 我在一个域名为something.eu的专用网络中,当我启动firefox时,代理会自动显示: and-etc-ha.something.eu : 9090

So i'm invited to enter my id and password. 因此,我被邀请输入我的ID和密码。 My id is : luc.myName@something.eu After that i'm connected to internet with firefox but not in terminal when i want to use apt. 我的身份证是: luc.myName@something.eu之后,我用firefox连接到Internet,但是当我想使用apt时不在终端中。

I search on the web and i found this: 我在网上搜索后发现:

export http_proxy="http://Username:password@proxyip:port/"

and

export http_proxy="http://Domain\user:pasword@proxyip:port/"

So I tried different ways and i was able to download with apt. 因此,我尝试了不同的方式,并能够使用apt下载。 But the internet connexion with firefox was unstable. 但是与Firefox的互联网连接不稳定。 But if I use firefox on my host machine the connexion is perfect. 但是,如果我在主机上使用firefox,则连接是完美的。

I also tried with settings -> network -> network proxy -> method manual 我也尝试过设置->网络->网络代理->方法手册

http: and-etc-ha.something.eu port: 9090

I don't know if I was understandable, tell me!^^ If you have any ideas to help me to solve this problem let me know. 我不知道我是否可以理解,请告诉我!^^如果您有任何帮助我解决此问题的想法,请告诉我。

Bye! 再见!

I found the cause: In fact there was a ip conflict inside the LAN because the DHCP was giving in-use ip address. 我找到了原因:实际上,因为DHCP提供了使用中的IP地址,所以局域网内部存在IP冲突。

I decide to use the NAT connection with Port Forwarding on VirtualBox. 我决定将NAT连接与VirtualBox上的端口转发一起使用。

With that configuration I'm able to access my VMs on my LAN using the host ip address followed by the port of my choice. 通过该配置,我可以使用主机ip地址和我选择的端口访问我LAN上的VM。

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

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