Results 1 to 3 of 3

Thread: Can't connect to local MySQL server

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    13

    Default 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

  2. #2
    Administrator AndrewT's Avatar
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    3,639

    Default

    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.

  3. #3
    Junior Member
    Join Date
    Jun 2004
    Posts
    13

    Default

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •