Can't connect to local MySQL server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • furpcom
    Junior Member
    • Jun 2004
    • 13

    #1

    Can't connect to local MySQL server

    On a semi regular basis I get the follow error from my site running at Dathorn:
    mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    If you retry, it works so I am not sure there is any problem with my code. I can not repeat the problem; it seems to be completely random.

    Has anyone else run into this? If so, how did you fix it?

    Thanks,

    Walter
  • AndrewT
    Administrator
    • Mar 2004
    • 3655

    #2
    If you are only getting these errors very briefly then this is likely due to the MySQL service being restarted. If you are seeing these errors often then this may point to other problems as MySQL is rarely offline.

    Comment

    • furpcom
      Junior Member
      • Jun 2004
      • 13

      #3
      It is very intermittent, maybe once a week or less. Maybe it is a MySQL restart issue. I will look into doing a retry on failure and that may solve the problem.

      The reason I was concerned is it leaves a bad impression when the user gets an error message and they may just leave with out a second try.

      Thanks for the quick follow on message Andrew.

      Comment

      Working...