Title: Database Connection Error in WP-Admin
Last modified: August 20, 2016

---

# Database Connection Error in WP-Admin

 *  Resolved [anotherusername](https://wordpress.org/support/users/anotherusername/)
 * (@anotherusername)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/database-connection-error-in-wp-admin/)
 * Hi,
 * I have added a blog to my website and have been (and still am to an extent) developing
   it on my own XAMPP Server.
 * I have uploaded the databse to my live site, changed the database and login details
   on wp-config so they are correct, and the blog now displays, so it’s obviously
   connecting and reading from the database on the ‘index’ page.
 * However if i try to click through on a post, or go to /wp-admin, i get a ‘Error
   establishing a database connection’ error.
 * Can someone explain what i’m missing as i don’t understand why it would read (
   connect) fine for the index page, but fail on click throughs or the admin section.
 * Thanks in advance

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

 *  [tomaltman](https://wordpress.org/support/users/tomaltman/)
 * (@tomaltman)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/database-connection-error-in-wp-admin/#post-2311795)
 * Did you change to the proper DB in the wp-config.php file? There are also a number
   of settings needed in the database.
 * The best luck I have had with this is install a fresh, clean install on your 
   server. Get it running the basic wordpress.
 * Then – move from the old site everything but wp_usermeta, wp_users & wp_options(
   this is for a normal install – not WP Multisite).
 * Make sense?
 *  Thread Starter [anotherusername](https://wordpress.org/support/users/anotherusername/)
 * (@anotherusername)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/database-connection-error-in-wp-admin/#post-2311826)
 * Hi Tom,
 * I figured it out, i hadn’t changed the url in options (it was still set as localhost),
   so i changed this, which locked me out of admin (!), but then just went into 
   the database and updated all the relevant rows.
 * My wp-config file was perfect, it was just out of date links in the databse basically,
   thanks for your post though 🙂

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

The topic ‘Database Connection Error in WP-Admin’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [anotherusername](https://wordpress.org/support/users/anotherusername/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/database-connection-error-in-wp-admin/#post-2311826)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
