Title: Error establishing a database connection
Last modified: August 20, 2016

---

# Error establishing a database connection

 *  [TonyaB](https://wordpress.org/support/users/tonyab/)
 * (@tonyab)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-296/)
 * I just updated to 3.2.1, everything works fine but every now and then I keep 
   getting “Error establishing a database connection” on both the admin interface
   and my website. What’s the problem?
 * I have not changed anything besides the upgrade.
    I also was having problems 
   with my images not uploading so I had to change the location under Media, which
   I do not think would cause this..

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

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-296/#post-2209200)
 * log in to host’s phpmyadmin
    select the correct database check mark all table
   choose “repair” from drop down at bottom of page issue should be fixed
 *  Thread Starter [TonyaB](https://wordpress.org/support/users/tonyab/)
 * (@tonyab)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-296/#post-2209225)
 * [@samuel](https://wordpress.org/support/users/samuel/) B I have done what you
   said and I just got the error again.
 *  Thread Starter [TonyaB](https://wordpress.org/support/users/tonyab/)
 * (@tonyab)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-296/#post-2209396)
 * I am still having this problem to this day, my site runs fine then I will get
   the database error message. Anyone??
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-296/#post-2209397)
 * Error connecting to your database is common, but it isn’t necessarily a problem
   with wordpress itself.
 * -First, try contacting the hosting provider if the database server is online /
   if they have any other problem at their end, or they made any changes to your
   account, or if there are any limitations/restrictions, etc .
 * – double check your wp-config.php file settings for the database name, database
   username and database password. This is where most errors occur.
 * -Then check that you don’t need to change the database host from “localhost” 
   to something else. You can get that info from your hosting provider.
 * -Check you have actually created a database with the same database name as is
   in your wp-config.php file.
 * -Last, but not least, if all that information is correct your database probably
   has a problem with it, and you may need to contact your hosting provider.
 * There are also many threads on this topic on these forums: [http://wordpress.org/search/Error+establishing+a+database+connection?forums=1](http://wordpress.org/search/Error+establishing+a+database+connection?forums=1)

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

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [t-p](https://wordpress.org/support/users/t-p/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-296/#post-2209397)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
