I was “transferring/downloading/replacing” my blog files and suddenly my blog homepage come up with this error. I spend the whole afternoon meddling with this error and now it’s solved. I realized this is a very common error faced when using wordpress and here’s a clearer solution on how to solve it.
Problem – “I keep getting an “Error establishing a database connection” but I’m sure my configuration is correct.”
1. Start by going to phpMyadmin which comes with your web host. (Take note of user which is highlighted below)

2. Click on your blog’s database name. As seen below I had it mosaic. Then click on the “SQL” tab. We are going to do a SQL Query to refresh the password.

3. If you are using a version of MySQL before version 4.1. Type in the line as above.
Otherwise use – SET PASSWORD FOR ‘example’@'localhost’ = OLD_PASSWORD(‘youroriginalpassword’)
4. SQL Query should execute successfully, and try refreshing your blog again.
I hope this helps.
If it fails, you may need to use your host’s control panel to reset the password for your database user or read additional resource from http://codex.wordpress.org/Installing_WordPress#Using_phpMyAdmin
