image1 image2 image3

HELLO I'M FERNANDO|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I'M PROFESSIONAL DEVELOPER

How to solve: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'


I'm going to discuss a problem I've had recently and it has taken me longer than expected to know what was happening.

For a few days, randomly my server has been displaying the message:

SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
The Apache server was working normally, but Drupal could not access the database because the Mysql process had died. I started looking at the trace of mysql to see may have happened. It did not show any error message. When looking at the trace of S.O. (using dmesg) saw a memory overflow error. After doing a little research on Google, I found that Apache, when there are a greater number of connections, use all available memory on the server, causing the mysql closes before he could write anything in your log file. The solution has been to adjust the apache settings to reduce the amount of memory consumed and leave enough room to other processes running (like MySQL).

Share this:

CONVERSATION

0 comentarios:

Post a Comment