在“读取初始通信数据包"时,与MySQL服务器的连接断开,Windows计算机上的系统错误:0 [英] Lost connection to MySQL server at 'reading initial communication packet', system error: 0 on a windows machine

查看:508
本文介绍了在“读取初始通信数据包"时,与MySQL服务器的连接断开,Windows计算机上的系统错误:0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了类似的问题,但没有一个问题帮助我使用Windows机器.

I found similar questions but none of them helped me with a windows machine.

我能够通过本地计算机连接到mySQL.但是,我将MySQL放在远程计算机上,当我尝试连接到它时,出现以下错误:

I was able to connect to mySQL through my local machine. However, I have placed MySQL on a remote machine and when I try to connect to it, I get the following error:

在读取初始通信数据包"时与MySQL服务器的连接丢失,系统错误:0

Lost connection to MySQL server at 'reading initial communication packet', system error: 0

我正在使用SQL工作台进行连接.我使用远程计算机的实际名称作为主机名,并使用端口139.同时,我也将MySQL作为服务启动到远程计算机上.谷歌搜索错误时,我对在/etc/hosts.allow和my.cnf等文件中编辑文件感到很困惑.但是,这些位置是为linux计算机指定的.我的本地和远程计算机都装有Windows 7计算机,因此没有这些位置.

Im using SQL workbench to connect. I use the remote machine's actual name for the hostname and using port 139. I have MySQL started up as a service on the remote machine as well. When googling the error I get lots of jazz about editing a file in /etc/hosts.allow and my.cnf and whatnot. However, these locations were specified for linux machines. I have a windows 7 machine for both my local and the remote machine and therefore do not have these locations.

任何帮助将不胜感激.

推荐答案

我不会假装我知道导致此问题的原因,但可能是:

I am not going to pretend that I know what caused this problem but it could be:

1.您需要添加

AllowTcpForwarding yes

此文件:/etc/ssh/sshd_config.显然,由于您在Windows上,因此需要找到等效项,因为这是linux文件路径.

to this file: /etc/ssh/sshd_config. Obviously since you are on windows you need to find its equivalent because that's a linux filepath.

2.它可能是您的防火墙.尝试暂时禁用它(如果可以的话),看看它是否有效.在这种情况下,您将需要通过防火墙授予MySQL访问权限.

2.It could be your firewall. Try temporarily disabling it (if it is safe to do so) and see if it works. If this is the case you will need to grant MySQL access through the firewall.

3.尝试写作

mysqld: ALL: allow

再次在文件/etc/hosts.allow中,因为您在Windows上,因此需要找到它的等效文件,因为这是linux文件路径.现在,从某种程度上来说,这可能是一个整体的安全性,但是当您没有正在运行的服务器时,谁会关心安全性?

In the file /etc/hosts.allow again since you are on windows you need to find its equivalent because that's a linux filepath. Now this may kind of be a security whole in some ways but who cares about security when you don't have a running server?

4.现在最后一次是检查/etc/hosts.deny.您的IP可能在那儿,拒绝您访问服务器.

4.Now the last this is to check /etc/hosts.deny your IP might be there denying you access to your server.

这篇关于在“读取初始通信数据包"时,与MySQL服务器的连接断开,Windows计算机上的系统错误:0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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