Title: Error establishing a database connection
Last modified: February 6, 2017

---

# Error establishing a database connection

 *  [bagpiper5](https://wordpress.org/support/users/bagpiper5/)
 * (@bagpiper5)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-802/)
 * Bluehost says there is something wrong in my core files
    I try the front/back
   door and receive: Error establishing a database connection It was OK- it was 
   running. I should not have to do any fix on my end. Really is this how jinky 
   wordpress is? I bought the host, I bought the theme and its up and running- and
   now it isnt. This is not my problem. Please check your databases or refresh. 
   Wayne [email redacted] bagpiperofbaltimore.com
    -  This topic was modified 9 years, 8 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years, 8 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-802/#post-8743726)
 * Was the site ever working? That is, is this a setup question or a break/fix question?
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years, 8 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-802/#post-8744179)
 * re-reading… “It was OK- it was running” Sorry.
 * So
 * 1. Did you change anything in wp-config.php?
 * 2. Can you access the database via phpmyadmin from the Bluehost control panel?
   If so, select all tables and, at the bottom, where it says “with all tables”,
   choose “check table” to see if any are corrupt.
 *  Thread Starter [bagpiper5](https://wordpress.org/support/users/bagpiper5/)
 * (@bagpiper5)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-802/#post-8770052)
 * Steve, I did as you suggested and there were not any errors.
    However, I did 
   find this:
 * A check of your WordPress directories produced the following errors/warnings:
 * Warning: File should not exist: wp-includes/error_log
 * Wayne
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years, 8 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-802/#post-8770262)
 * That might be an issue, but it’s not the issue you started with. Your error is
   that you are not properly connecting to the database. Please double check the
   4 DB_ defines in wp-config.php.
 *  Thread Starter [bagpiper5](https://wordpress.org/support/users/bagpiper5/)
 * (@bagpiper5)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-802/#post-8785533)
 * Steve,
    Is this what you were talking about?
 * /** MySQL database username */
    define(‘DB_USER’, ‘redacted);
 * /** MySQL database password */
    define(‘DB_PASSWORD’, ‘redacted’);
 * /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);
 * /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’,‘
   utf8’);
 * /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’,”);
    -  This reply was modified 9 years, 8 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years, 8 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-802/#post-8786218)
 * 1) I removed the passwords in your post. NEVER post passwords. Please change 
   your DB password immediately.
 * 2) Let’s assume that error_log file really is a problem.
 * Remain calm and carefully follow [this guide](https://codex.wordpress.org/FAQ_My_site_was_hacked).
   When you’re done, you may want to implement some (if not all) of [the recommended security measures](https://codex.wordpress.org/Hardening_WordPress).
 * If you’re unable to clean your site(s) successfully, there are reputable organizations
   that can clean your sites for you. Sucuri, SiteLock and Wordfence are a few.

Viewing 6 replies - 1 through 6 (of 6 total)

 The topic ‘Error establishing a database connection’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-802/#post-8786218)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
