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

I'm having problem with this error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

It appears every few minutes but after few seconds everything is ok...

Have you guys any solution for that?

share|improve this question

migrated from Aug 5 '11 at 3:49

This question came from our site for professional and enthusiast programmers.

Version? Access method? (C, JDBC, ...) – Ondra Žižka Aug 5 '11 at 2:55
up vote 0 down vote accepted

I think in the error message the number 2 in parentheses is errno: No such file or directory

Who is removing the socket? I would find that out with with Linux audit facility. It is very helpful when diagnosing problems such as this.

Edited to add: Is your mysqld server process dying for some reason? It might remove the socket if it dies. Then the wrapper script re-starts the mysqld process and the socket gets re-created.

share|improve this answer

Perhaps connection pool's connection timed out? Or maybe too many connections?

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.