Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Error establishing a database connection

General questions about VestaCP
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
nccdebug
Posts: 19
Joined: Sat Nov 16, 2013 2:26 pm

Error establishing a database connection
  • Quote

Post by nccdebug » Tue Dec 17, 2013 6:51 am

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
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Error establishing a database connection
  • Quote

Post by skid » Wed Dec 18, 2013 8:57 pm

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
Top

nccdebug
Posts: 19
Joined: Sat Nov 16, 2013 2:26 pm

Re: Error establishing a database connection
  • Quote

Post by nccdebug » Mon Dec 23, 2013 8:10 pm

Thank you Skid. How about using a swap file? any advantage over "decrease memory consumption by tuning my.cnf file"
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Error establishing a database connection
  • Quote

Post by skid » Tue Dec 24, 2013 2:41 pm

Well, it's up to you to decide. Sometimes swap can improve overall health.
Top


Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password