Site is giving "Error establishing a database connection" error

June 1, 2016 293 views
Control Panels MySQL Ubuntu 16.04

Hello sir! I am new to Digitalocean and i am using serverpilot for hosting Wordpress. One of my site "" is giving "Error establishing a database connection". I don't know why! but i searched on internet a lot about this and found that i need to check my database name, user, pass and host in wp-config.php file are correct or not. I checked and found it is correct. Please throw some light at me and tell me how can i remove this error. I am completely Noob and i have never used Hosting without Cpanel as my last hosting was of Interserver. Please help me.!!!

1 Answer


The most common cause of this error is your server running out of memory and killing MySQL. Take a look at this article for more information and other possible causes:

Have another answer? Share your knowledge.