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?

link|improve this question
Version? Access method? (C, JDBC, ...) – Ondra Žižka Aug 5 '11 at 2:55
feedback

migrated from stackoverflow.com Aug 5 '11 at 3:49

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

2 Answers

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.

link|improve this answer
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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