The value of MaxUserPort and TcpTimedWaitDelay we used may not be optimum for your case. Connection to MySQL Server Failing on WindowsĪfter raising the MaxUserPort to 20000 and lowering TcpTimedWaitDelay to 20 (needed a reboot) the connection error never occured. After further serching we found this page:ī.5.2.2.1. So it should not be mysql's problem.Īfter following jlupolt's suggestion we found that default ephemeral port range (1024~5000) of the web server (not the db server, it's another machine in our case) is all full with TIME_WAIT state. Perform the following sql:grant all privileges on open Access database.
The memory usage and CPU loading of db server was still very low during this period and the open connection of mysql server is far below the limit of max_connections of it. Log on to MySQL on the server via the command line or client 2. Some high exposure banner ads drive a lot of traffic to our site during a short period of time (hours) and "Can't connect to MySQL server." error randomly (not always) occurs. Thanks to jlupolt's post as it precisely pointed out the key to solve the problem I was facing.
