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.
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.
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?
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.