We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2896
    • 70 Posts
    Hi there,

    i’ve been encountering some problems with our modx site. Often (every two weeks or so) there seems to be a lot of errrors about the connection with Mysql

    in the error log there are thousands of lines:
    [27-Jun-2007 15:04:57] PHP Warning: 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) in /home/pcvogent/public_html/manager/includes/extenders/dbapi.mysql.class.inc.php on line 85

    sometimes also errors about too_many_connections

    + via ftp I see a lot of core files that indicate some sort of crash. I’ve contacted customer support of the host, but they don’t see anything particular.
    Except, and I quote

    "I can see only one connection at this moment:
    | localhost:55032 |
    Is there any reason why you are connecting to port 55032? This seems suspicious?
    The connection seemed to be coming from the server itself, not from your computer. In any case, I’m afraid I don’t know which of your scripts is causing the MySQL problems. Do you have any PHP script that is probably running for longer than 30 seconds? It might be overriding the max execution limit and leaving MySQL connections open"




    But I have not more than 13 Mysql users, most of which are not often used, and for the modx database connection I have a unique user that is nowhere else used.

    There was a custom php.ini file in the root of the site (probabaly copied earlier on with old site - no modx) that had mysql.allow_persistent = On

    So I put this to ’Off’ thinking that this was the cause, but nope!
    Again lots of errors today...


    some info about the site-host:
    shared hosting site5.com
    Modx version 0.9.5
    PHP/4.4.4
    MySQL version 4.1.21-standard-log


    Any ideas here, this is bugging me! huh
    Thx

      • 25663 MODX Staff
      • 12,272 Posts
      Delete the Template Switcher plugin.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 2896
        • 70 Posts
        I’ve done that already
          • 2896
          • 70 Posts
          Just double checked, and indeed It is no longer there ...

          There is a plugin "Edit Plugin Execution Order by Event" that i didn’t see before, is this necessary?
            • 22303 MODX Staff
            • 10,725 Posts
            That’s not a plugin, but a new option to allow you to make plugins run in a specific order for each event.
              • 2896
              • 70 Posts
              Ok, thx
                • 31337
                • 258 Posts
                Check to make sure your mysql is set up to connect via local loopback, and not over TCP/IP. The port connection seems awfully suspicious in that regard. In the global my.conf file, you should have something like:
                socket=/var/lib/mysql/mysql.sock
                


                Depending on your hosting setup, this might be something you’re not able to control though
                  • 2896
                  • 70 Posts
                  Probably I don’t have control, but i could go thru customer support

                  What should I exactly ask?
                  via local loopback, and not over TCP/IP.


                  Is quite chinese for me ;-)

                  thx for feedback!