I found similar questions but none of them helped me with a windows machine. I originally posted this on stack overflow but it was suggested that I ask here.

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 from the local, 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 with connecting to mySQL would be greatly appreciated.

  • Port 139? That's the NetBIOS port. MySQL runs on port 3306 by default. – yoonix Jul 30 '14 at 19:06
  • For whatever reason, when checking netstat -na it shows it is listening on port 139, not 3306. I tried 3306 and the connection fails immediately. – Daniel Julian Jul 30 '14 at 19:35
  • What is your MySQL configuration? – Tero Kilkanen Jul 30 '14 at 19:58
  • With the initial setup config wizard I did the following: Selected Detailed configuration, Developer Machine, Multifunctional database, decision support (up to 20 connections), Enabled TCP/IP and Stricts Mode (I did make the port number 3306), and a standard character set – Daniel Julian Jul 30 '14 at 20:29
  • I would assume that you are facing the permission issue. Double-check the permissions and accounts. – Net Runner Jul 16 '17 at 7:54

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.

| improve this answer | |


Note to self: When setting up SSH, you MUST set the following option in /etc/ssh/sshd_config:

AllowTcpForwarding yes

If you don't, then your packets will be silently dropped at the server. This results in the above error message.

| improve this answer | |
  • Thank you for the hint... – helt Feb 23 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.