Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
    
Version? Access method? (C, JDBC, ...) –  Ondra Žižka Aug 5 '11 at 2:55
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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.