Database issues class_core.php on line 312

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dgkrob
    New Member
    • Feb 2009
    • 10

    [Forum] Database issues class_core.php on line 312

    Hi,

    As of tonight i have suddenly been getting alot of issues with the following error

    Database error in vBulletin :

    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) /home/dgk2009/public_html/includes/class_core.php on line 312

    i have had over 100 emails in the last hour with the same error.

    Can anyone please advise what has happened here?

    Thanks in advance

    Rob
  • Andy
    Senior Member
    • Jan 2002
    • 5886
    • 4.1.x

    #2
    I have seen many admins report this over the past few years. Nobody seams to know why this happens. On my server I will get this error once in a while, like once a week. I will get about 20 emails with the time only about 30 seconds apart from the first email to the last one. It's as if the sql server is too busy and the vbulletin email is reporting this. But there are no adverse effects so the error message is somewhat erroneous.

    Comment

    • tcoffey
      New Member
      • Mar 2010
      • 5
      • 4.0.0

      #3
      This does cause an issue

      Wrong! I got this error for awhile and did the maintenance using the admincp link to rebuild/repair tables. The error went away for awhile, that was the good news. The bad news that is I just got the same error and as of this moment nothing will come up. The server is up and running fine and I have confirmed that mysql is running fine but the app is not.
      Now I have to go deep dive to see what the issue really is.

      Comment

      • Andy
        Senior Member
        • Jan 2002
        • 5886
        • 4.1.x

        #4
        Here is a related thread which might shed some light on the solution.

        Comment

        • tcoffey
          New Member
          • Mar 2010
          • 5
          • 4.0.0

          #5
          Originally posted by Andy
          Here is a related thread which might shed some light on the solution.

          http://www.vbulletin.com/forum/showt...h-MySQL-Errors
          Thanks for the feedback. I did my deepdive and yes I did see that it was a max connection issue. By default I think the setting is 100 and in some cases you may not even see a line that states your max connections. I increased the number of max connections in mine and the issue went away.

          Thanks again for the assistance.

          Comment

          • Andy
            Senior Member
            • Jan 2002
            • 5886
            • 4.1.x

            #6
            Originally posted by tcoffey
            I did my deepdive and yes I did see that it was a max connection issue.
            Could you elaborate a bit on this. I have yet to see where an error log shows that max connections issues. I'm running Centos.

            Thank you.

            Comment

            • tcoffey
              New Member
              • Mar 2010
              • 5
              • 4.0.0

              #7
              Originally posted by Andy
              Could you elaborate a bit on this. I have yet to see where an error log shows that max connections issues. I'm running Centos.

              Thank you.
              The error log does not show a max connection issue but if you look at the line in the code and what is happening you will see that it is trying to perform a connection. From what I could tell it looks like some of the active connections were not being closed sometimes correctly. It really depends on just how deep you want me to go into this? What tool are you using to do your development in php? If you are a coder then we can get pretty deep but if not then I would just say that the library that is currently being used by VB to perform all the database calls should have a little more error trapping in it.
              if you want to see what your current settings are do a
              mysqladmin -u username -p variables
              where username is the name you have setup to access the database.

              Although my issue went away I am still looking at other ways to solve this issue rather then just increasing the max connections. I still think there is an issue when closing a connection sometimes.

              Comment

              • Andy
                Senior Member
                • Jan 2002
                • 5886
                • 4.1.x

                #8
                Thank you tcoffey.

                I made the change to mysql config file and set the max connections from 300 to 500, but I still have yet to restart mysql. I just put in a request for my web hosting provider to let me what command to use to restart mysql. Apparently the suggestions offered in Google searches do not work. I'll report back after I restarted mysql and waited a week or two to see if those errors stopped.

                Comment

                • tcoffey
                  New Member
                  • Mar 2010
                  • 5
                  • 4.0.0

                  #9
                  Originally posted by Andy
                  Thank you tcoffey.

                  I made the change to mysql config file and set the max connections from 300 to 500, but I still have yet to restart mysql. I just put in a request for my web hosting provider to let me what command to use to restart mysql. Apparently the suggestions offered in Google searches do not work. I'll report back after I restarted mysql and waited a week or two to see if those errors stopped.
                  I do not believe you have to restart it.
                  add this line to your my.cnf file that is located in /etc folder. This issue is more of a server issue so you have to make the change in this file.

                  max_connections=500

                  if your my.cnf file does not have this line do not worry just add it.
                  Good luck

                  Comment

                  • graham_w
                    Member
                    • Apr 2005
                    • 35
                    • 4.0.0

                    #10
                    If you make any changes to my.cnf you need to restart mysql before the changes will take effect.

                    Comment

                    • tcoffey
                      New Member
                      • Mar 2010
                      • 5
                      • 4.0.0

                      #11
                      Originally posted by graham_w
                      If you make any changes to my.cnf you need to restart mysql before the changes will take effect.
                      well that answers that. lol

                      Thanks for the info.

                      I normally do anyway just to be safe.

                      Comment

                      • Andy
                        Senior Member
                        • Jan 2002
                        • 5886
                        • 4.1.x

                        #12
                        I didn't have any luck restarting mysql. So I rebooted the server. Hopefully with the max_connections=500 setting I will no longer have these occasional error messages. Time will tell.

                        Comment

                        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                        Working...