WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A site that was working fine previously is now getting an error,

Error establishing a database connection

I have dealt with this error while creating new wordpress sites(when there was something wrong with the config file). This time, the error occurred when the user upload a file to public_html folder. Can anyone suggest me what would have gone wrong and how to fix it?

Thanks in advance.

share|improve this question
Did you checked your wp-config.php file? Is database name or password is changed? – Sisir Aug 6 '11 at 7:30
Where is that located? Can you please guide me? – Fahad Uddin Aug 6 '11 at 7:49
up vote 3 down vote accepted

Did you checked your wp-config.php file? Is database name or password is changed?

wp-config.php file is located on the root directory you installed wordpress. Open the file and you will see database password, username etc that wordpress use to connect your database. Check the username, passwords are correct.

/** The name of the database for WordPress */
define('DB_NAME', 'your_database_name');

/** MySQL database username */
define('DB_USER', 'your_database_username');

/** MySQL database password */
define('DB_PASSWORD', 'your database password');
share|improve this answer
I think that the config file was damagad. thanks – Fahad Uddin Aug 7 '11 at 1:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.