My site is running in wordpress, it was running fine for past 3 months. Yesterday suddenly my site showed "Error establishing a database connection". I have not changed anything in the site.I contacted my host and they don't know to fix the error. my site lost all traffic.

  • 3
    Have you tried rebooting the server(s)? Is your host supposed to provide server and application support for your web site? If not, why would you expect them to know how to fix it?
    – joeqwerty
    Apr 25, 2011 at 13:51
  • 2
    can you connect to the database from the command line? Have you checked the logs? Apr 25, 2011 at 13:53
  • 2
    Are you getting any other errors? Can you reach the database via other means? Why would you assume that their dev team is foolish because they don't or won't fix your issue?
    – GregD
    Apr 25, 2011 at 13:55
  • it is a shared server... so i can't ask them to boot...
    – Ashok
    Apr 25, 2011 at 13:56
  • i contacted more than 10 times... everytime i contact them, they are saying that whole development team is working on the problem... but still it is not got fixed...
    – Ashok
    Apr 25, 2011 at 13:57

2 Answers 2


Do you have access to the server via ssh? If you do then check if your database is running and that you can connect to it from the command line.

The error message is very clear. As you mentioned you don't have access and the provider said he is working on it. How would serverfault be able to help you? Is your provider open to suggestions and is willing to share log information with you? That would help narrow down the problem.

You said you hadn't changed anything in the last 3 months. What about the provider, has he made any changes? Has the provider taken any steps to insure that user data is separated in the shared server environment?

  • i don't have access to SSH...
    – Ashok
    Apr 25, 2011 at 14:27
  • 2
    now I'm confused: how do you expect serverfault to help you? Apr 25, 2011 at 15:24

In order to receive help, you should provide more information. Which OS is running?

But, trying to help: ok, you don't have SSH access, but, do you have any kind of access to the server?

This is the first step, determine if the servers are talking each other.

Try to connect to the server (where WP is installed) and try to reach the database server. Start with a simple PING. Certify that the web server has connection to the database server. If PING isn't allowed, try other ways, such as a TELNET to the database listening port (by default mysql listen to 3306).

You could also check the reverse: from the console of the database server, try to reach the WP server. Since it's a web server, you can telnet port 80.

If you're able to certify that server are communicating with each other, go to the application level.

Do you have access do WP config files? Wich user is being used to establish connection? You told that phpMyadmin is working. Can you check if the user that you use in order to connect WP to MySQL has the appropriate access levels (grant)?

Are you using the IP or DNS in order to make the connection between servers? If DNS, checkit to see if the names are resolving properly (nslookup/dig).

If you cover this basic steps, and post the results, we could help more.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .