Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A Perl/CGI webapp that has been running fine for almost a year has started to randomly been unable to connect to a remotely hosted MySQL. The Error thrown is :

Can't connect to MySQL server on '' (111)

Reloading the page often solves the problem The client is using Perl, DBI and SSL to connect to MySQL using the same configuration file each time.

MySQL 5.0 Server Running RH EL5

  • Quad-Core AMD Opteron(tm) Processor 2374 HE, 8 cores
  • Real Memory: 15.73 GB total, 11.81 GB used
  • allows networking in my.cnf

  • max-connections are not being met

  • load is low.

  • The servers firewall is open to the client's subnet.

  • The mysql user has permissions from the client's subnet.

I have my host looking into the problem but so far we're all stumped as to way the occasional connection is (increasingly getting refused)

Any advice what to check that would cause the random refusal of connections?

share|improve this question
Could Fail2Ban possibly be blocking the script's IP for a few seconds due to another service running from the same IP triggering Fail2Ban? – Daemon of Chaos Jun 17 '11 at 16:18
I don't believe so, other traffic from the same IP is able to connect, within a second. I'll pass the suggestion on to my host though! – joatis Jun 17 '11 at 16:43

The cause was do to a infrastructure problem with my host. My Scripts were hosted in a Cloud environment. A "neighbor" on the node was was exhausting all the outbound ports. Once the host managed the traffic better by adding capacity the problem stopped.

I'm guessing that I was getting the (111) error because by the time the connections were able to get to the database server through the clouds firewall they were considered timed out.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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