Error establishing a database connection
Error establishing a database connection
Hi everyone,
I get the following error with MySQL; I restarted MySQL server many times it solved the issue for some time, but it keeps coming again:
Magento site: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
Wordpress site: Error establishing a database connection
Please help
I get the following error with MySQL; I restarted MySQL server many times it solved the issue for some time, but it keeps coming again:
Magento site: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
Wordpress site: Error establishing a database connection
Please help
Re: Error establishing a database connection
It look like MySQL server runs out of memory and dies. If you can not increase memory on a server, you can try to decrease memory consumption by tuning my.cnf file. Depending on your operating system config file is located in /etc/mysql/my.cnf or /etc/my.cnf
I suggest to start with decreasing following parameters:
max_connections
max_user_connections
I suggest to start with decreasing following parameters:
max_connections
max_user_connections
Re: Error establishing a database connection
Thank you Skid. How about using a swap file? any advantage over "decrease memory consumption by tuning my.cnf file"
Re: Error establishing a database connection
Well, it's up to you to decide. Sometimes swap can improve overall health.