0

I'm running MySQL 5.6 on a WinServer 2012 system. It works great. The server is on our office intranet, not accessible to the outside world. I normally administer MySQL remotely from my office on my laptop, so I've got my user privileges set to accept my login from all hosts ("%").

This morning I came in and could not get a response remotely from MySQL. If I go to the server, the server manager shows MySQL is running (I've stopped and restarted the MySQL service to no avail). I can log in to MySQL locally from the server. Netstat shows:

TCP    0.0.0.0:3306     0.0.0.0:0       LISTENING

Going to my laptop, I try to telnet to the ip address of the server and port 3306 and get:

Could not open connection to the host, on port 3306: Connection failed

This happened one time about six months ago and I ended up having to just shut down the whole Windows Server machine (cycle power). When it came back up, everything was great. This time, I don't want to have to shut down the machine (it really disrupts users of other services on the machine).

I suspect the port is just bound for some reason and needs to be released and reset.

Any suggestions on how I can make the server accept remote connections again without cycling power?

Thanks.

EDIT 1:

Based on @GioMac's suggestion, I did a wireshark on both client and server. Both showed the same thing. Here is the server's wireshark capture.

The IP address ending in .20 is the server and the one ending in .30 is the client:

NO. Time        Source          Destination     Pro Len Info
89  4.141088    192.168.1.30    192.168.1.20    TCP 66  61697 → 3306 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1
143 7.137597    192.168.1.30    192.168.1.20    TCP 66  [TCP Retransmission] 61697 → 3306 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1
259 13.137832   192.168.1.30    192.168.1.20    TCP 62  [TCP Retransmission] 61697 → 3306 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 SACK_PERM=1

So, the packets are being received by the server TCP stack.

One other big piece of info: I've cycled power on the server hardware twice now. Still have the same problem. Please help. Thanks.

Jonathan M
  • 137
  • 2
  • 10
  • Did you tried restart MySql Service instead of whole system ? Any log on MySql log files ? – Froggiz Nov 20 '15 at 16:07
  • Regarding restarting MySQL service, yes (see 2nd paragraph). Regarding the log, there are no errors, just notes, with the final note being `mysqld.exe: ready for connections. Version: 5.6.21-log' socket: '' port: 3306 MySL Community Server (GPL)`. Notice that the socket is empty. – Jonathan M Nov 20 '15 at 16:14
  • If you telnet the server ip t prot 3306 from your laptop does the connection estabilishes? – Fredi Nov 20 '15 at 16:27
  • @Fredi, No. I stated so above in my original post, paragraphs 4 and 5. – Jonathan M Nov 20 '15 at 16:31
  • @JonathanM sorry, you're right, i readed it as you were using mysql client. Do you have a firewall on the server by chance? Another thing i would check, be sure it's mysql that is listening on that port, see here how to do it: http://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows – Fredi Nov 20 '15 at 16:43
  • @Fredi, please see the original post. I already did a `netstat` and it shows the service is listening on the right port. There is no firewall involved between my laptop and the server. – Jonathan M Nov 20 '15 at 16:51
  • Install Wireshark on both server and clients and check if network packets are correctly delivered. – GioMac Nov 20 '15 at 16:56
  • @GioMac, good suggestion. Please see the edit above. – Jonathan M Nov 20 '15 at 18:39
  • @JonathanM Both server and client have TCP retransmission? – GioMac Nov 20 '15 at 18:45
  • @GioMac, both server and client wireshark captures show the 3 transmissions from the client: the original transmission and two retransmissions. – Jonathan M Nov 20 '15 at 18:46
  • @JonathanM Seems your laptop is not getting a tcp SYN-ACK from the server according to your wireshark capture. Is that all the data it captures?If so, looks like a TCP connection problem. – Gmck Nov 20 '15 at 18:52
  • I think you're right. I'll re-title the question and add tags appropriately. – Jonathan M Nov 20 '15 at 18:53
  • Looks like server is not answering at all :) Which means, you have enabled Windows Firewall, or some part of TCP stack is stuck, antivirus might also be a issue. – GioMac Nov 20 '15 at 18:53
  • Are you connected to a VPN? Is there a correct route to the server enabled? Can you ping the server? – Gmck Nov 20 '15 at 18:59
  • @Gmck, there's no VPN. Client and server are on the same subnet, separated only by a wireless hub. – Jonathan M Nov 20 '15 at 19:10
  • Can you ping the server? – Gmck Nov 20 '15 at 19:12
  • @Gmck, I can ping it; I can get a response from the web service on it; I can connect using windows file sharing. – Jonathan M Nov 20 '15 at 19:16
  • Port 3306 is being blocked, made clear by the absence of the SYN-ACK. – Gmck Nov 20 '15 at 19:21
  • @Gmck, so perhaps something changed on the server Windows firewall? Is that what's most likely? If so, how best to rectify? – Jonathan M Nov 20 '15 at 19:23
  • I can only speculate at this point, but the firewall would be a good place to start. Have a look the config to see if the port is closed. – Gmck Nov 20 '15 at 19:44
  • Go ahead and put that suggestion as an answer @Gmck. I'll accept it. For some reason, the inbound rules have changed on Win Firewall. – Jonathan M Nov 20 '15 at 20:00

1 Answers1

1

I can only speculate at this point, but the firewall would be a good place to start. Have a look the config to see if the port is closed.

Gmck
  • 389
  • 1
  • 8