1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

An unexpected database error ?every now and than?

Discussion in 'Troubleshooting and Problems' started by Yashua, Sep 28, 2011.

  1. Yashua

    Yashua Member

    Hey guys I just setup my first xenforo and I noticed every now and than it gives a weird error i look in the source and find this.

    Code:
    An unexpected database error occurred. Please try again later.
    <!-- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) -->
    I than refresh the page and the errors gone
    What do? :(
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That is a generic MySQL connection error. The database connection is failing for some reason.

    Since it's intermittent you can probably ignore it. The server might have been undergoing maintenance or something. But if the error persists then you need to contact your web host.
     
    Yashua likes this.
  3. Yashua

    Yashua Member

    Thank you I got them to restart mysql and it is still happening if I spam refresh on the page it happends once every 5 refreshes is there by any chance like a setting in php to make it so it doesn't giveup trying to connect to mysql so fast like it will try 20 times or 5 times also I'm using litespeed instead of apache.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    This is something the web host needs to fix. Tell them the database connection is failing intermittently. Give them the error message.
     
  5. Floris

    Floris Guest

    If you're on shared hosting, perhaps consider moving to a hosting provider that doesn't have stability issues with their MySQL server. If you're on a VPS, there might be a different underlying problem that requires a super user to take a look at the mysql log file to find out why it's shutting down (restarting perhaps).
     
  6. EasyTarget

    EasyTarget Well-Known Member

    Does XenForo use persistent connections? Maybe Yashua is exceeding the max number of connections?
     
  7. Floris

    Floris Guest

    Doubtful.
     
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Nope. The error message would indicate that.
     
  9. Digital Doctor

    Digital Doctor Well-Known Member

    Common Problem.
    Xenforo forums get this as well.
    Likely quota thing or connection thing.
    Contacting your HOST provider is the likely course of action.
     

Share This Page