·
Added a discussion

Out of the blue I would get an email about database error, on my live and test site. Neither one has any traffic.

The error is same for both sites;

Mysql error:

SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

Then it shows debag backtrace and settings section and last line is:

called script;

Request parameters:

array ( '/home/websitename/public_html/periodic/cron_php' => '', )

Most of the days everything is ok then a few emails of error then ok again?

Can anyone help whats going on here?

Thanks in advance!

  • 972
Comments
    • Hello @Nurke !

      This error means the application is not able to locate the socket file needed to establish a MySQL connection. The easiest fix to try - change the following line in the inc/header.inc.php file:

      define('BX_DATABASE_HOST', 'localhost'); ///< db host

      to this variant

      define('BX_DATABASE_HOST', '127.0.0.1'); ///< db host

      If it will not help then it's better to send the report about it to the hosting support.

      • Thank you @LeonidS for your help!

        I have changed localhost word to 127.0.0.1 ( This number is ok right? Not some other?)

        I did contact tmd yesterday and they said they did some repair, but error showed today again. The thing is that I get this error sometimes, not all the time. I did your fix so all I can do is to wait and see if error will show up again... and will report back...

        Thank you Very much!

        • Hi @LeonidS

          Just got another email with db error...

          Mysql error:

          SQLSTATE[HY000] [2002] Can't connect to MySQL server on '127.0.0.1' (115)

          The only difference now is that the Called script is /index.php .

          After TMD supposedly did some repair, I was told that if it happens again I need to find DB specialist....?? For " run your community..out of the box" ???

          Do you have any idea what I can try next?

          Thanks in advance!

          • That's interesting, ok, then undo this solution. About TMD's reply - could you plz forward me via messenger their letter?

            Login or Join to comment.