1

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

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:

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

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.

Any help would be greatly appreciated.

miken32
  • 42,008
  • 16
  • 111
  • 154
Daniel Julian
  • 19
  • 1
  • 2
  • Why port 139? That's Windows NetBIOS. MySQL uses 3306 by default. – Jim Garrison Jul 30 '14 at 19:09
  • Because after doing a netstat -na I found that it was listening to dthub1 with a port of 139. If I use 3306 it instantly fails. That might be because I'm not using localhost since I'm trying to connect to another machine. – Daniel Julian Jul 30 '14 at 19:21
  • How do you know port 139 is associated with MySQL? Any Windows machine will always be listening to port 139. – Jim Garrison Jul 30 '14 at 19:45
  • I don't, so that's probably the problem. However, it's not listening to 3306 so that is also a problem. – Daniel Julian Jul 30 '14 at 19:52

2 Answers2

3

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

1.That you need to add

AllowTcpForwarding yes

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.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.Try writing

mysqld: ALL: allow

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.Now the last this is to check /etc/hosts.deny your IP might be there denying you access to your server.

GenuinePlaceholder
  • 685
  • 1
  • 10
  • 25
  • Thank you for the response, I appreciate it. Unfortunately, I have no idea where to find those locations. I've searched my entire MySQL folder and nothing even comes close to sshd_config or hosts.allow. – Daniel Julian Jul 30 '14 at 19:34
  • Try searching your whole computer. I am pretty sure it *might* be in some system owned folder. Just do a quick search: Start>Search – GenuinePlaceholder Jul 30 '14 at 19:49
  • Couldn't find them via start search. I'm assuming the files will be called something different in windows. I have a my-default.ini file that has very limited configurations. – Daniel Julian Jul 30 '14 at 19:57
  • Sorry I could not help. They probably are called something different. – GenuinePlaceholder Jul 30 '14 at 21:10
0

Figured it out. 'root' was pointing to the root of the local machine and the root user on the remote machine was pointing to itself. So I had it connect to an admin user and it connected fine with no errors. Thanks for for the responses and help guys.

Daniel Julian
  • 19
  • 1
  • 2